我在 Centos7 上运行 apache 2.4.6 的服务器上安装了 phpMyAdmin,我收到错误,因为您无权访问此服务器上的 /phpmyadmin。
我的服务器 ip 是62.210.xx.xx
我62.210.xx.xx/phpmyadmin/
从另一个 ip 远程浏览xx.xx.xx.xx
/etc/httpd/conf.d/phpMyAdmin.conf
# phpMyAdmin - Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory "/usr/share/phpMyAdmin/">
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
Require ip 62.210.xx.xx
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
#Order Deny,Allow
#Allow from 127.0.0.1
#Allow from ::1
#Allow from 62.210.xx.xx
#Deny from All
Allow from All
</IfModule>
</Directory>
<Directory "/usr/share/phpMyAdmin/setup/">
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
Require ip 62.210.xx.xx
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Allow from 127.0.0.1
Allow from ::1
Allow from 62.210.xx.xx
#Deny from All
#Allow from All
</IfModule>
</Directory>
# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory "/usr/share/phpMyAdmin/libraries/">
#Order Deny,Allow
#Deny from All
#Allow from None
</Directory>
<Directory "/usr/share/phpMyAdmin/setup/lib/">
#Order Deny,Allow
#Deny from All
#Allow from None
</Directory>
<Directory "/usr/share/phpMyAdmin/setup/frames/">
#Order Deny,Allow
#Deny from All
#Allow from None
</Directory>
# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc. This may break your mod_security implementation.
#
#<IfModule mod_security.c>
# <Directory "/usr/share/phpMyAdmin/">
# #SecRuleInheritance Off
# </Directory>
#</IfModule>
我已经添加了行Require ip 62.210.xx.xx
,并Allow from 62.210.xx.xx
按照此处其他问题的建议,但仍然无法正常工作。
请查看并建议任何可能的方法。
谢谢
更新它的工作,Require all granted
但这Require mylocalIP
不是我想要的,我只想从我的服务器 ip62.210.xx.xx
或本地 ip 范围允许