Securing phpmyadmin: non-standard port + https
        Posted  
        
            by 
                elect
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by elect
        
        
        
        Published on 2012-11-04T14:19:32Z
        Indexed on 
            2012/11/04
            23:02 UTC
        
        
        Read the original article
        Hit count: 281
        
Trying to secure phpmyadmin, we already did the following:
- Cookie Auth login 
- firewall off tcp port 3306. 
- running on non-standard port 
Now we would like to implement https... but how could it work with phpmyadmin running already on a non-stardard port?
This is the apache config:
# PHP MY ADMIN
<VirtualHost *:$CUSTOMPORT>
    Alias /phpmyadmin /usr/share/phpmyadmin
    <Directory /usr/share/phpmyadmin>
        Options FollowSymLinks
        DirectoryIndex index.php
        <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>
    # Disallow web access to directories that don't need it
    <Directory /usr/share/phpmyadmin/libraries>
        Order Deny,Allow
        Deny from All
    </Directory>
    <Directory /usr/share/phpmyadmin/setup/lib>
        Order Deny,Allow
        Deny from All
    </Directory>
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/phpmyadmin.log combined
</VirtualHost>
© Server Fault or respective owner