apache2.4 報Forbidden You don't have permission to access / on this server.
阿新 • • 發佈:2019-01-01
檢視apache版本
D:\phpStudy\PHPTutorial\Apache\bin>httpd -v
Server version: Apache/2.4.23 (Win32)
Server built: Jul 1 2016 16:42:20
Apache2.2的做法
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
改成
<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Allow from all </Directory>
Apache2.4的做法
apache2.4 把Order deny,allow Deny from all兩項合併為Require all denied的
所以加上這兩項就好了
AllowOverride none
Require all denied
例如:
<Directory /> Options +Indexes +FollowSymLinks +ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted AllowOverride none Require all denied </Directory>