Installing phpMyAdmin onto Amazon EC2 instance(将 phpMyAdmin 安装到 Amazon EC2 实例上)
问题描述
我已按照 亚马逊教程.这似乎运行正常(我可以在上传好的文件中看到 phpinfo()
).
I've configured my EC2 instance as a LAMP, following Amazon's tutorial. That appears to be functioning correctly (I can see phpinfo()
in a file I've uploaded OK).
然后我尝试通过执行以下操作来安装 phpMyAdmin:
I then tried to install phpMyAdmin by doing the following:
sudo yum --enablerepo=epel install phpmyadmin
我可以看到phpMyAdmin现在在/usr/share/phpmyadmin
,所以我添加了一个符号链接:
I can see that phpMyAdmin is now in /usr/share/phpmyadmin
, so I added an symbolic link:
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
然后我编辑了 http.conf
将 AllowOverride all
添加到
.(命令:sudo nano/etc/httpd/conf/httpd.conf
)
I then edited http.conf
to add AllowOverride all
to <Directory "/var/www/html">
. (Command: sudo nano /etc/httpd/conf/httpd.conf
)
然后重启服务器:
sudo service httpd restart
但是每当我访问 http://ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com/phpmyadmin
我都会收到来自服务器的 403 Forbidden 响应: 您无权访问此服务器上的/phpmyadmin.
But whenever I visit http://ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com/phpmyadmin
I get a 403 Forbidden response from the server: You don't have permission to access /phpmyadmin on this server.
我觉得我遗漏了一些非常明显的东西,但我不知道是什么.
I feel like I'm missing something really obvious, but I cannot figure out what.
推荐答案
我需要更新 /etc/httpd/conf.d/phpMyAdmin.conf
以允许远程用户.
I needed to update the /etc/httpd/conf.d/phpMyAdmin.conf
to allow remote users.
我只是像这样替换了第一个
标签的内容...
I just replaced the contents of the first <directory>
tag like so...
我删除了:
<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
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
并用这个替换它:
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Order allow,deny
Allow from all
</Directory>
并重启服务器:sudo service httpd restart
现在工作!
这篇关于将 phpMyAdmin 安装到 Amazon EC2 实例上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将 phpMyAdmin 安装到 Amazon EC2 实例上


- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- SQL 临时表问题 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 更改自动增量起始编号? 2021-01-01