启动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>
这怎么了?如何解决错误?
您需要在目录中使用Require。即
<Directory "/var/www/html">
Require all granted
<Directory>