在xampp\apache\conf\extra\httpd-vhosts.conf中,之前的配置是这样的:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "F:/code/study/php"
ServerName www.aaa.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-www.aaa.com-error.log"
CustomLog "logs/www.aaa.com-access.log" common
</VirtualHost>
启动xmapp的apache之后,访问提示403 access forbidden
这种情况下,需要修改下这里的配置为:
<VirtualHost *:80>
<Directory "F:/code/study/php">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "F:/code/study/php"
ServerName www.aaa.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-www.aaa.com-error.log"
CustomLog "logs/www.aaa.com-access.log" common
</VirtualHost>
重启xmapp的apache,访问ok~