Apache 禁止:你不';我没有权限访问/访问此服务器(centos 7)

Apache 禁止:你不';我没有权限访问/访问此服务器(centos 7),apache,permissions,centos,httpd.conf,httpforbiddenhandler,Apache,Permissions,Centos,Httpd.conf,Httpforbiddenhandler,我在主机上安装了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> Docum

我在主机上安装了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>
ServerRoot”/etc/httpd
听80
包括conf.modules.d/*.conf
用户apache
组apache
服务器管理员root@localhost
不允许超限
要求所有授权
DocumentRoot“/home/admin/domains/morabi.app/public\u html”
不允许超限
要求所有授权
选项索引跟随符号链接
不允许超限
要求所有授权
DirectoryIndex.html
要求全部拒绝
当我在浏览器中加载我的ip地址时,它已被“禁止”
您没有在此服务器上访问/的权限。错误。和/home/admin/domains/morabi.app权限为755也加载了文件,但我的ip有禁止错误

您需要将以下内容添加到其中

<Directory "/home/admin/domains/morabi.app/public_html">
# 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

# The solution for your error, allows your files to be served, learn more about this at https://httpd.apache.org/docs/2.4/howto/access.html
Require all granted
</Directory>

上面的命令将更改文件夹及其内部文件的所有者。如果将所有者更改为运行命令的用户不起作用,请将
$USER
更改为
apache
,但如我上述所述,请始终在之前进行备份。

还请尝试删除以#符号开头的行。我想我以前是错的,但如我上述所述尝试此操作。我的答案现在起作用了吗?
chown $USER:$USER public_html -R