Virtualmin 和 phpmyadmin - 您无权访问此服务器上的 /phpmyadmin/

Virtualmin 和 phpmyadmin - 您无权访问此服务器上的 /phpmyadmin/

我无法访问 phpmyadmin。我尝试了在 Google 上找到的所有方法。也许有人可以帮助我?谢谢您的回答。

Forbidden

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

我使用带有 virtualmin 的 CentOS 5。

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/>
   #order deny,allow
   #deny from all
   allow from 127.0.0.1
   allow from ::1
</Directory>

# This directory does 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>

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

配置.inc.php

...
$cfg['Servers'][$i]['auth_type']     = 'http';      // Authentication method (config, http or cookie based)
...

答案1

您没有从 127.0.0.1 或 ::1 地址访问 phpmyadmin。

您需要找出您从哪个地址访问 phpmyadmin,并将其添加到允许地址列表中。这很可能是您的服务器的公共 IP 地址。

例如,如果你的公共 IP 地址是 192.168.1.54,那么你可以将其添加到你的配置中

<Directory /usr/share/phpMyAdmin/>
   #order deny,allow
   #deny from all
   allow from 192.168.1.54
   allow from 127.0.0.1
   allow from ::1
</Directory>

相关内容