禁止:您无权访问此服务器上的/(centos 7)

问题描述 投票:0回答:1

我在主机上安装了httpd,并按如下所示更改了httpd.conf文件

ServerRoot "/etc/httpd"

Listen 80


Include conf.modules.d/*.conf


User apache
Group apache

ServerAdmin root@localhost

<Directory />
    AllowOverride none
    Require all granted
</Directory>
DocumentRoot "/home/admin/domains/morabi.app/public_html"

<Directory "/var/www">
    AllowOverride None
    Require all granted
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks

    AllowOverride None

    Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

当我在浏览器中加载我的IP地址时,它已显示“禁止您没有访问此服务器上的/的权限。”错误。/home/admin/domains/morabi.app权限为755,文件也已加载,但我的IP http://x.x.x.x/禁止错误

apache permissions centos httpd.conf httpforbiddenhandler
1个回答
0
投票

您将需要添加以下内容,

<Directory "/home/admin/domains/morabi.app">
# Learn more about this at https://httpd.apache.org/docs/2.4/mod/core.html#options
Options Indexes FollowSymLinks

# Learn more about this at https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride
AllowOverride All

Require all granted
</Directory>
© www.soinside.com 2019 - 2024. All rights reserved.