mysql 抱歉,您没有权限访问该版块

13z8s7eq  于 2023-05-21  发布在  Mysql
关注(0)|答案(1)|浏览(111)

我已经在服务器上安装了cacti,当试图通过网络连接它“http://192.168.1.3/cacti/“然后得到错误像“你没有权限访问/cacti/在这台服务器上”.
我在谷歌上搜索,并尝试更改/etc/httpd/conf.d/cacti.conf文件如下-
缺省值为-

# Cacti: An rrd based graphing tool
#
Alias /cacti    /usr/share/cacti

<Directory /usr/share/cacti/>
        Order Deny,Allow
        Deny from all
        Allow from localhost
</Directory>

我试着改变-

# Cacti: An rrd based graphing tool
#
Alias /cacti    /usr/share/cacti

    <Directory /usr/share/cacti/>
            Order Deny,Allow
            #Deny from all
            Allow from all
    </Directory>

在此更改和重新启动httpd服务后,网页上没有出现任何错误,而是在资源管理器选项卡中出现403禁止错误的空白页面。
也尝试允许特定的ips,但没有运气。其他一些建议也得到了检查,但无法得到解决方案。
我将非常感谢任何及时的帮助。

inn6fuwd

inn6fuwd1#

我知道这有点晚了,但我发现下面的格式解决了这个问题:

<IfModule mod_authz_core.c>
    # httpd 2.4
    Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
    # httpd 2.2
    Order allow,deny
    Allow from all
    Deny from none
</IfModule>

我已经在CentOS 7和Rocky 9上验证了这一点。过了很长一段时间,我才注意到文件开头的注解:

# For security reasons, the Cacti web interface is accessible only to
# localhost in the default configuration. If you want to allow other clients
# to access your Cacti installation, change the httpd ACLs below.
# For example:
# On httpd 2.4, change "Require host localhost" to "Require all granted".
# On httpd 2.2, change "Allow from localhost" to "Allow from all".

我希望这个解决方案可以帮助任何正在与这个问题作斗争的人。

相关问题