0

I use phpmyadmin I want to restrict the access of certain ips, I have this in my apache.conf

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

I think that I can use .htaccess in /usr/share/phpmyadmin in the same way that /var/www/html but it doesn't work.

How I can restrict the access of phpmyadmin ?

1 Answer 1

0

The AllowOverride None is preventing the processing of any .htaccess file under /usr/share.

You would need to make a new configuration in the vhost for phpmyadmin that contains something similar to the following (replace All with whatever .htaccess directives you want to restrict to):

<Directory /usr/share/phpmyadmin>
        AllowOverride All
</Directory>

Since you are have access to the server configuration, you would also be able to add your IP restrictions there (replace 10.10.10.10 with an ip you would allow access from):

<Directory /usr/share/phpmyadmin>
        Require ip 10.10.10.10
</Directory>

You can add more IPs separated by space.

You must log in to answer this question.