如何修复Apache 2.4,启动时不需要在此处允许

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

启动Apache 2.4时出现以下错误。

httpd[11435]: AH00526: Syntax error on line 22 of /etc/httpd/conf.d/vhost1.conf:
httpd[11435]: Require not allowed here

以下行在vhost1.conf中导致此错误

<VirtualHost myserver:80>
    DocumentRoot "/var/www/html"
    Require all granted
</VirtualHost>
<VirtualHost myserver:443>
    DocumentRoot "/var/www/html"
    Require all granted
</VirtualHost>

这怎么了?如何解决错误?

apache apache2 httpd.conf apache2.4
1个回答
0
投票

您需要在目录中使用Require。即

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