【问题标题】:You don't have permission to access /phpMyAdmin on this server您无权访问此服务器上的 /phpMyAdmin
【发布时间】:2015-10-06 18:18:02
【问题描述】:
我在 Amazon Linux EC2 实例中安装了 LAMP 服务器,如 here 中所述。现在,问题是当我尝试访问http://publicdns/phpMyAdmin 时,它告诉我Forbidden: You don't have permission to access /phpMyAdmin on this server.
我尝试了各种尝试解决此问题的文章,甚至尝试使用符号链接。由于大部分其他文章都是基于手动安装phpMyAdmin,我无法得到正确的结果。
我知道我必须访问一些文件并更改配置,但我不知道如何正确执行。
【问题讨论】:
标签:
linux
apache
amazon-web-services
amazon-ec2
phpmyadmin
【解决方案1】:
您需要在 phpMyAdmin.conf 的 Allow 部分下添加您的 IP,以便能够远程访问您的 phpMyAdmin。
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
<RequireAny>
Require ip my-server-ip-here
Require ip ::1
Require ip <your ip>
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
Order Deny,Allow
Allow from my-server-ip-here
Allow from ::1
Allow from <your ip>
</IfModule>
</Directory>
重新启动 apache 发布这些更改。