Restricting IP address not working in phpmyadmin.

Discussion in 'Installation/Configuration' started by emad, Mar 26, 2016.

  1. emad

    emad Member

    In the default configuration of phpmyadmin with ISPconfig-3 as perfect server on Ubuntu.
    Strange thing happens, "Order Deny,Allow" & "Deny from All" works for sub-directories but not for the root of them.

    /usr/share/phpmyadmin (Not working)
    /usr/share/phpmyadmin/setup (working)
    /usr/share/phpmyadmin/libraries (working)
    /usr/share/phpmyadmin/setup/lib (working)

    Can you explain this behavior? Do i miss something?

    Note: Ubuntu version 12.04.5 LTS

    Code:
    # phpMyAdmin default Apache configuration
    
    Alias /phpmyadmin /usr/share/phpmyadmin
    
    <Directory /usr/share/phpmyadmin>
            Options FollowSymLinks
            DirectoryIndex index.php
    
            ......
            Order Deny,Allow
            Deny from All
    
    </Directory>
    
    # Authorize for setup
    <Directory /usr/share/phpmyadmin/setup>
        Order Deny,Allow
        Deny from All
    
        .......
    </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>
     
  2. MaxT

    MaxT Active Member

    It works for me:
    /etc/apache2/conf.d/phpmyadmin.conf
    Code:
    <Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php
     AllowOverride All
    order deny,allow
    deny from all
    allow from xx.xx.xx.xx.
    </Directory>
     
  3. emad

    emad Member

    I figured it out there is a configuration duplication. The main configuration file of PhpMyAdmin package (/etc/apache2/conf.d/phpmyadmin.conf) configure the directory "/usr/share/phpmyadmin", and ISPConfig re-configured it again in "/etc/apache2/sites-available/ispconfig.conf"! Honestly I didn't expect this duplication but I choose to disable the one in "/etc/apache2/sites-available/ispconfig.conf" and restriction now works.

    ISPConfig is great but I think developers should consider this small issue and alike.
     
  4. MaxT

    MaxT Active Member

    but that file /etc/apache2/sites-available/ispconfig.conf is commented inside: "ISPConfig Logfile configuration for vlogger"
    It sounds only for vlogger, I think
     

Share This Page