PHPMyAdmin禁止IP访问后访问后
-
21-12-2019 - |
题
我有新的安装灯具服务器。然后我尝试通过IP地址阻止访问我的PHPMyAdmin。
sudo nano /etc/apache2/conf.d/phpmyadmin.conf
.
然后输入:
<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>
.
在浏览器时重新启动Apache后,Forbidden.you don't have permission to access /phpmyadmin on this server
.Even已提到。
在更改为没有代理后,它可以工作。为什么?如何解决这个问题?
解决方案
如果使用代理,您的IP可能对外面有所不同(即,您的流量从计算机到代理,然后到服务器)。
您的配置是正确的,因为您可以直接访问它。问题是您需要不使用代理,或者将代理的IP添加到配置中。
其他提示
我今天跑进了这个问题,遇到了这个帖子。Nanne的解决方案是有效的,但如果您仍然有问题检查以查看PHP如何运行。如果它是FastCGI,您需要添加选项包括exccgi ,如...
<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php
Options Includes ExecCGI
.
修复了我的问题!
更改allowoprodide无 allowoverride all. 并重新启动服务httpd
不隶属于 StackOverflow