Apache 2.4 Httpd 403在Centos 7的流浪者中被禁止

Apache 2.4 Httpd 403在Centos 7的流浪者中被禁止,apache,vagrant,Apache,Vagrant,在安装了Centos7和httpd(Apache 2.4)之后,我在/etc/httpd/conf.d中测试testa.dev.conf,如下所示 <VirtualHost *:80> ServerName html.testa.dev DocumentRoot "/var/www/html/testa.dev/htdocs" <Directory "/var/www/html/testa.dev/htdocs"> Options

在安装了Centos7和httpd(Apache 2.4)之后,我在
/etc/httpd/conf.d
中测试
testa.dev.conf
,如下所示

<VirtualHost *:80>
    ServerName html.testa.dev
    DocumentRoot "/var/www/html/testa.dev/htdocs"

    <Directory "/var/www/html/testa.dev/htdocs">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride None
        Require all granted
    </Directory>
</VirtualHost>
创建测试页面的步骤
/srv/www/testb.dev/htdocs/index.html

授予权限

chown -R apache:apache /srv/www/testb.dev/htdocs
chmod -R 755 /srv/www/testb.dev/htdocs

我的想法是直截了当的。只想将
/var/www
更改为
/srv/www
。但我似乎仍然错过了一些配置。

试试
set0
你说得对。但是,如果要投入生产,该怎么做而不是直接运行
setEnforce0
?您可以永久运行,也可以修复,非常感谢您的参考。尝试
setEnforce0
您是对的。但是,如果要投入生产,除了直接运行
setEnforce0
之外,还应该做些什么呢?您可以永久运行,也可以修复,非常感谢您的参考。
chown -R apache:apache /srv/www/testb.dev/htdocs
chmod -R 755 /srv/www/testb.dev/htdocs