My/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 xx.xx.xx.xxx
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
#Deny from All
Allow from xx.xx.xx.xxx
Allow from ::1
</IfModule>
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip xx.xx.xx.xxx
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
#Deny from All
Allow from xx.xx.xx.xxx
Allow from ::1
</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>
当我在我的页面访问EC2实例时http://xx.xx.xx.xxx/phpmyadmin,我有You don't have permission to access /phpmyadmin on this server.
错误。我确定了这个ip地址xx.xx.xx.xxx is my EC2's Elastic IP address
。phpMyadmin.conf允许正确的xx.xx.xx.xxx。我试着遵循这个,这个和这个的相似链接。但是仍然有错误。我的错误可能出了什么问题?我的EC2实例安装了AWS linux操作系统。
感谢
据我所知,此配置与PhpMyadmin有关。为了将此配置加载到Apache Web Server中,如果您使用的是Apache[Not Apache2]和Apache2.conf[for-Apache2],请通过查看httpd.conf
来确保Apache正在从conf.d
加载所有配置文件。
在/etc/apache2/apache2.conf中,您会发现以下行,其中包括这些文件:
# Include generic snippets of statements
Include conf.d/
【参考文献】
你可能已经检查过了,这是解决方案之一。
我也有同样的错误。关注此链接https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html以执行所有所有者和组更改。像你上面做的那样做了所有的事情,但它犯了那个错误。最后,在重新启动httpd之后,我可以连接了。