phpmyadmin accessible for only predefined ip addresses

Discussion in 'Linux Beginners' started by iceget, Apr 1, 2022.

  1. iceget

    iceget Member

    dear community,

    i have installed ispconfig (current version). per default i can access from all ip-addresses the SERVER/phpmyadmin url.
    is there a possibility to allow access to phpmyadmin only from predefined ipaddresses?

    how i can configure that?

    thank you so much

    many greets
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Disable the alias in /etc/apache2/conf-available/phpmyadmin.conf, then restart apache2, then add the alias to one of your websites through the options tab in ISPConfig:
    Code:
    Alias /phpmyadmin /usr/share/phpmyadmin
     
  3. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    I use the following on a control panel node. We allow phpmyadmin from anywhere on web server nodes so that clients can access their databases (though we block root, ispconfig and debian-sys-maint logins), and limit phpmyadmin access on the control panel to a few administrative addrs:
    Code:
    # cat /etc/apache2/conf-enabled/local.conf
    # local (to this server) config snippets
    
    # This is ispconfig-cp, phpmyadmin is useful but we restrict access to only admin ip addrs
    # (restrictions are under <Files> because ispconfig grants access in later config file)
    <Directory /usr/share/phpmyadmin>
            <Files '*'>
                    <RequireAny>
                            Require host admin1.domain.tld
                            Require ip xx.xx.xx.xx
                            Require ip xx.xx.xx.yy
                            Require ip xx.xx.yy.0/24
                            Require all denied
                    </RequireAny>
            </Files>
    </Directory>
    
     

Share This Page