解决 XAMPP + Windows 问题:Access Forbidden Error 403

配置好这 httpd-vhosts.conf、httpd.conf 和 hosts 文件

httpd-vhosts.conf

在 C:\xampp\apache\conf\extra\httpd-vhosts.conf 增加你需要的 virtual host,设置好路径:

<VirtualHost xshell.com:80>
DocumentRoot “E:/work/python/test/shell”
ServerName xshell.com
<Directory “E:/work/python/test/shell”>
#Order allow,deny
#Allow from all
Require all granted
</Directory>
</VirtualHost>

httpd.conf

在 C:\xampp\apache\conf\httpd.conf 把路径加入:

<Directory “E:/work/python/test/shell”>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>

hosts

最后修改 C:\Windows\System32\drivers\etc\hosts 把域名解析到本机:

127.0.0.1 xshell.com

发表评论

电子邮件地址不会被公开。 必填项已用*标注