首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >访问ec2实例上的phpMyAdmin时出现403错误

访问ec2实例上的phpMyAdmin时出现403错误
EN

Stack Overflow用户
提问于 2015-08-28 02:49:50
回答 2查看 10.4K关注 0票数 1

我想在amazon's tutorial之后使用Amazon-Linux在一个新的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文件以允许访问。

当前文件:

代码语言:javascript
复制
# 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>

但是,当我尝试访问/phpMyAdmin时,仍然收到403错误

error_log:

代码语言:javascript
复制
[Thu Aug 27 13:45:47.702678 2015] [authz_core:error] [pid 25763] [client 37.49.61.176:59958] AH01630: client denied by server configuration: /usr/share/phpMyAdmin/
[Thu Aug 27 13:45:48.699611 2015] [authz_core:error] [pid 25763] [client 37.49.61.176:59958] AH01630: client denied by server configuration: /usr/share/phpMyAdmin/
[Thu Aug 27 13:49:22.181819 2015] [authz_core:error] [pid 25765] [client 37.49.61.176:60222] AH01630: client denied by server configuration: /usr/share/phpMyAdmin/

错误还可能是什么?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-09-13 00:24:57

这个问题在我删除了

代码语言:javascript
复制
Alias /phpMyAdmin /usr/share/phpMyAdmin

从…

代码语言:javascript
复制
/etc/httpd/conf.d/phpMyAdmin.conf

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

代码语言:javascript
复制
sudo service httpd restart
票数 5
EN

Stack Overflow用户

发布于 2016-04-01 18:27:22

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

我在这里找到的

http://howsolve.com/i-always-get-a-403-error-with-phpmyadmin-ec2-aws/

代码语言:javascript
复制
    # 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>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32257267

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档