当前位置: 首页 > 面试题库 >

禁止:您无权访问此服务器上的/ phpmyadmin

郑哲彦
2023-03-14
问题内容

嗨,我已经在我的centos机器上安装了phpmyadmin,当我尝试phpmyadmin通过浏览器访问时,出现此错误:

Forbidden
You don't have permission to access `phpmyadmin` on this server.

我的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/>
   <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/setup/>
   <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>

# 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>

请帮助我解决此问题。任何线索表示赞赏。

谢谢


问题答案:

您需要执行以下步骤:

查找以下内容的行

Require ip 127.0.0.1

替换为您的工作站IP地址:

Require ip 10.1.3.53

再次找到以下行:

Allow from 127.0.0.1

替换为:

Allow from 10.1.3.53

还要deny from all在整个文件中找到并注释它。

保存并关闭文件。Restart Apache httpd server

# service httpd restart

编辑:由于这是选定的答案,并获得最佳可见性…请还请 确保已安装PHP ,否则会出现相同的Forbidden错误。



 类似资料:
  • 我一直在寻找我的问题的答案,但是我找不到任何解决我问题的答案。 问题是我无法访问var/www/文件夹中的应用程序文件夹。当我转到localhost/I时,我会收到一条消息,表明我的服务器正在运行,并且我也可以访问phpmyadmin。但是,当我转到任何本地主机/文件夹名称时,会出现403错误: 被禁止的 您没有访问此服务器上的/folder name/的权限。 Apache/2.2。本地主机端口

  • 问题内容: 我正在使用Ubuntu 10.04。 我下创建一个Django项目命名 并创建一个WSGI文件在同一目录 下面是内容: 这是我添加到我的httpd.conf中的内容: 问题是,当我访问http:// localhost时,它说 禁止的 您无权访问此服务器上的/。 非常感谢。 问题答案: 第二个目录块与您安装WSGI脚本文件的位置不匹配。尽管将WSGI脚本文件粘贴在存在源代码或其他敏感文

  • 我正在尝试运行一个php应用程序,但不断获得 “禁止您没有访问此服务器上的/文件夹的权限。” 我有在我的httpd.conf中未注释,我还尝试设置权限 和 我的phpadmin在那个文件里。我可以从浏览器访问phpadmin,并获得IT WORKS默认页面,但由于权限问题,无法访问我的应用程序文件夹。 这是我在httpd-vhosts.conf中的vhost设置(注意:我在实际文件中确实有一个实际

  • 问题内容: 我正在使用Ubuntu 10.04。 我下创建一个Django项目/命名 并创建一个WSGI文件在同一目录 下面是内容: 这是我添加到我的httpd.conf中的内容: 问题是,当我访问http:// localhost时,它说 问题答案: 第二个目录块与你安装WSGI脚本文件的位置不匹配。尽管将WSGI脚本文件粘贴在存在源代码或其他敏感文件的位置(即同一目录或子目录)是非常不好的做法

  • 我自己配置了我的Apache,并试图在虚拟主机上加载phpMyAdmin,但我收到: 403禁止您没有访问/访问此服务器的权限 我的httpd.conf 和vhosts.conf:

  • 我有一个运行Drupal8的DrupalServer(UBUNTU)。如果我将一些php文件放在根目录中,我可以在浏览器中运行它们,但当我将同一文件放在子目录中时,浏览器给出了403禁止的错误。我已经将权限更改为777,但它不起作用。 有人能帮我吗? “禁止的 您没有访问此服务器上myfile的权限。Apache/2.4。18(Ubuntu)服务器,192.168。51.60端口80“