phpMyAdmin
I changed my config file to use SSL, but it still doesn't redirect.
6 Replies
# 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>
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
<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.
# Force https:// on phpMyAdmin login.
Redirect /path/to/pma https://example.com/path/to/pma/
Works great!
And I don't know where the *.crt file is : (
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
sudo /etc/init.d/apache2 restart