Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 403在ec2实例上访问phpMyAdmin时出错_Mysql_Amazon Web Services_Amazon Ec2_Phpmyadmin - Fatal编程技术网

Mysql 403在ec2实例上访问phpMyAdmin时出错

Mysql 403在ec2实例上访问phpMyAdmin时出错,mysql,amazon-web-services,amazon-ec2,phpmyadmin,Mysql,Amazon Web Services,Amazon Ec2,Phpmyadmin,我想使用AmazonLinux在一个新的EC2实例上安装一个LAMP环境。然后我想让phpMyAdmin安装,所以我使用sudo-yum--enablerepo=epel install phpMyAdmin安装了它,并创建了一个指向www目录sudo-ln-s/usr/share/phpMyAdmin/var/www/html/phpMyAdmin的链接 然后我修改了/etc/httpd/conf.d/phpMyAdmin.conf文件以允许访问 当前文件: # phpMyAdmin - We

我想使用AmazonLinux在一个新的EC2实例上安装一个LAMP环境。然后我想让phpMyAdmin安装,所以我使用
sudo-yum--enablerepo=epel install phpMyAdmin
安装了它,并创建了一个指向www目录
sudo-ln-s/usr/share/phpMyAdmin/var/www/html/phpMyAdmin
的链接

然后我修改了
/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

<Directory /usr/share/phpMyAdmin/>
 AddDefaultCharset UTF-8

 Order allow,deny
 Allow from all
</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>

还有什么可能是错误?

在我删除后,问题得到了解决

Alias /phpMyAdmin /usr/share/phpMyAdmin

然后不要忘记使用以下命令重新启动

sudo service httpd restart

问题在我删除后得到解决

Alias /phpMyAdmin /usr/share/phpMyAdmin

然后不要忘记使用以下命令重新启动

sudo service httpd restart

将以下代码复制到/etc/httpd/conf.d/phpMyAdmin.conf

我在这里找到的

#phpMyAdmin-用php编写的基于Web的MySQL浏览器
# 
#默认情况下仅允许本地主机
#
#但是应该考虑允许phpMyAdmin访问本地主机以外的任何人
#危险,除非通过SSL进行适当保护
别名/phpMyAdmin/usr/share/phpMyAdmin
AddDefaultCharset UTF-8
命令允许,拒绝
通融
#这些目录不需要通过HTTP访问-从原始目录获取
#塔巴尔上游的phpMyAdmin
#
命令拒绝,允许
全盘否定
从无到有
命令拒绝,允许
全盘否定
从无到有
命令拒绝,允许
全盘否定
从无到有
#此配置可防止phpMyAdmin目录中的mod_安全性受到攻击
#过滤SQL等。这可能会破坏您的mod_安全实现。
#
#
#    
#保密
#    
#

将以下代码复制到您的/etc/httpd/conf.d/phpMyAdmin.conf

我在这里找到的

#phpMyAdmin-用php编写的基于Web的MySQL浏览器
# 
#默认情况下仅允许本地主机
#
#但是应该考虑允许phpMyAdmin访问本地主机以外的任何人
#危险,除非通过SSL进行适当保护
别名/phpMyAdmin/usr/share/phpMyAdmin
AddDefaultCharset UTF-8
命令允许,拒绝
通融
#这些目录不需要通过HTTP访问-从原始目录获取
#塔巴尔上游的phpMyAdmin
#
命令拒绝,允许
全盘否定
从无到有
命令拒绝,允许
全盘否定
从无到有
命令拒绝,允许
全盘否定
从无到有
#此配置可防止phpMyAdmin目录中的mod_安全性受到攻击
#过滤SQL等。这可能会破坏您的mod_安全实现。
#
#
#    
#保密
#    
#

我刚刚删除了该别名行,似乎解决了问题。我也有同样的问题。但是在/etc/httpd/conf.d/directory中找不到phpMyAdmin.conf文件。我刚刚删除了该别名行,似乎解决了问题。我也有同样的问题。但是在/etc/httpd/conf.d/中找不到phpMyAdmin.conf文件directory@Arfan-你的答案没有明确提到您建议的更改/修复是什么。只需在下面的路径/etc/httpd/conf.d/phpMyAdmin.conf中复制上述代码,然后重新启动apacheservices@Arfan-您的答案没有明确提到您建议的更改/修复。只需在下面的路径/etc/httpd/conf.d/phpMyAdmin.conf中复制上述代码,然后重新启动apache服务
    # 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

    <Directory /usr/share/phpMyAdmin/>
     AddDefaultCharset UTF-8

     Order allow,deny
     Allow from all
    </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>