Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: phpMyAdmin
PostPosted: Tue Apr 19, 2011 10:50 am 
Offline
Junior Member

Joined: Mon Apr 11, 2011 9:49 pm
Posts: 49
How do I force https? It seems to always use http? :(

I changed my config file to use SSL, but it still doesn't redirect.


Top
   
 Post subject:
PostPosted: Tue Apr 19, 2011 1:51 pm 
Offline
Senior Member

Joined: Mon Dec 20, 2010 11:37 pm
Posts: 76
Just use apache rewrite:

Code:
# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://mysecure.mydomain.com%{REQUEST_URI}

    <IfModule mod_php5.c>
        AddType application/x-httpd-php .php

        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_flag register_globals Off
        php_value include_path .
    </IfModule>

</Directory>


Top
   
 Post subject:
PostPosted: Tue Apr 19, 2011 4:59 pm 
Offline
Junior Member

Joined: Mon Apr 11, 2011 9:49 pm
Posts: 49
doh.. I always make the dumbest mistakes.. xD

If you go through;
mysite.com/phpMyAdmin/setup/
^ You can setup your mysql settings.

Once your done, you can do the following;
rm -rf setup # We don't need the setup folder anymore...
mv config/config.inc.php config.inc.php # Move the saved config file.
rm -rf config # Remove the config folder.

Then it automatically resets to https mode, although sometimes it doesn't work right.. thanks for the .htaccess rewrite code :D


Top
   
 Post subject:
PostPosted: Wed Apr 20, 2011 1:16 am 
Offline
Senior Newbie

Joined: Wed Aug 18, 2010 9:50 pm
Posts: 6
Website: http://lesharris.com/
Location: Olympia, WA
No need to use rewrite. You can just use Redirect. It doesn't get simpler than this! :) Here's something very similar to what I use on my linode:

Code:
<VirtualHost *:443>
  ServerName mydomain.com
 
  CustomLog /var/log/apache2/mydomain.com/access.log combined
  ErrorLog /var/log/apache2/mydomain.com/error.log
  SSLEngine on
  SSLCertificateKeyFile /etc/ssl/ssl.key/mydomain.key
  SSLCertificateFile /etc/ssl/ssl.crt/mydomain.crt
  SSLCertificateChainFile /etc/ssl/ssl.crt/mydomain.ca-bundle
</VirtualHost>
<VirtualHost *:80>
  ServerName mydomain.com
  Redirect / https://mydomain.com
</VirtualHost>


Then Apache will just autoredirect from http to https.


Top
   
 Post subject:
PostPosted: Fri Apr 22, 2011 7:23 am 
Offline
Junior Member

Joined: Mon Apr 11, 2011 9:49 pm
Posts: 49
found a easier method, but I used some of your code to do it. I manually set a https redirect in my vhost;
Code:
# Force https:// on phpMyAdmin login.
Redirect /path/to/pma https://example.com/path/to/pma/

Works great! :)


Top
   
 Post subject:
PostPosted: Wed Aug 03, 2011 5:52 am 
Offline
Newbie

Joined: Wed Aug 03, 2011 5:47 am
Posts: 3
Yahoo Messenger: vpmhieu
Location: Vietnam
I follow instructions in
http://library.linode.com/security/ssl-certificates/self-signed

And I don't know where the *.crt file is : (


Top
   
 Post subject: Re: phpMyAdmin
PostPosted: Wed Jul 11, 2012 9:00 pm 
Offline
Senior Member

Joined: Wed Nov 16, 2011 8:15 am
Posts: 70
don't forget to issue these commands:

Code:
sudo a2ensite default-ssl

enables HTTPS for your apache2 install (even though the apache2/sites-available/default-ssl file is configured for HTTPS)

and of course restart
Code:
sudo /etc/init.d/apache2 restart

_________________
My VPS system:
(Ubuntu 14.04 LTS, Kernel 3.15.4-x86_64, Apache 2.4.7, MariaDB Server 5.5.40, MariaDB Client 5.5.41, PHP 5.5.9, ISPConfig 3.0.5.4p5, Webmin, PureFTP & Quota, phpMyAdmin, postfix, dovecot, amavis, clamav, spamassassin, awstats, fail2ban, Jailkit, bind9, vlogger, webalizer)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group