1、如果有开启虚拟目录,先看下虚拟目录的配置是否正确,保证localhost对应的目录存在。

# Virtual hosts

Include "conf/extra/httpd-vhosts.conf"


<VirtualHost *:80>

    DocumentRoot "G:/webroot/"

    ServerName localhost

</VirtualHost>

2、在httpd.conf文件中找到<Directory,将后面的部分修改成网站访问目录的上一层,比如我的网站全部文件存在在G:/webroot/,那么应该将<Directory "G:/">,Options Indexes FollowSymLinks,设置好,保存退出重启即可。