Question

I have fresh install lamp server. Then I try to block access to my phpmyadmin by ip address.

sudo nano /etc/apache2/conf.d/phpmyadmin.conf

Then input :

<Directory /usr/share/phpmyadmin>
       Options FollowSymLinks
       DirectoryIndex index.php
       Options Includes ExecCGI
       AllowOverride None
       Deny From All
       Allow from 127.0.0.1
       Allow from 10.230.38.xxx  -->this is my ip
</directory>

After restart the apache at browser appear Forbidden.you don't have permission to access /phpmyadmin on this server.Even my ip have been mentioned. After change to no proxy it can works. Why? and how to fix this?

Was it helpful?

Solution

If you use a proxy, your IP could be different for the outside (namely, your traffic goes from your computer to the proxy, and then to the server).

Your configuration is correct, because you can access it directly. The problem is you need to either not use a proxy, or add the proxy's IP to your configuration.

OTHER TIPS

I ran into this problem today and came across this thread. Nanne's solution is valid, but if you're still having issues check to see how PHP is running. If it's with FastCGI, you'll need to add Options Includes ExecCGI like so...

<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php
    Options Includes ExecCGI

That fixed my problem!

change AllowOverride None with AllowOverride All and restart service httpd

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top