You don't have permission to access/on this server

Windows安装laravel出现You don't have permission to access / on this server. 安装完wamp以后,安装网上的教程设置虚拟路径,出现了问题,一样的问题由不一样的缘由致使。但愿对有些大意的人有帮助。php

一、httpd.conf去掉Include conf/extra/httpd-vhosts.conf前面的#。laravel

二、httpd.conf中添加Listen 相应的端口,个人是8080web

三、在conf\extra下面的httpd-vhosts.conf文件中添加ide

<VirtualHost *:8080>
DocumentRoot D:/wamp/www/aa
ServerName localhost
<Directory “d:/wamp/www/aa”>
    Options Indexes FollowSymLinks 
    Order allow,deny
    Allow from all
    AllowOverride All
</Directory>

</VirtualHost> 四、而后调用localhost,就出现下面的错误:this

Forbidden You don’t have permission to access /on this server.code

(没有设置这一切时,localhost访问的没有问题的)server

五、最后发现是没有删掉httpd-vhosts.conf文件中的这段代码致使的:教程

<VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot “c:/Apache23/docs/dummy-host.example.com” ServerName dummy-host.example.com ServerAlias www.dummy-host.example.com ErrorLog “logs/dummy-host.example.com-error.log” CustomLog “logs/dummy-host.example.com-access.log” common </VirtualHost>get

删掉或者注释掉这段代码,再运行localhost就没有问题了。io

六、localhost运行好使了,但运行localhost:8080却有新的问题:

Forbidden You don’t have permission to access /index.phpon this server.

七、而后也是找了不少,可能是说什么allow from all等等的问题。但不管我怎么设置都是这个问题。

几经波折,发现把Options Indexes FollowSymLinks 后面添加上 ExecCGI就好使了。 <VirtualHost *:8080> DocumentRoot D:/wamp/www/aa ServerName localhost <Directory “d:/wamp/www/aa”> Options Indexes FollowSymLinks ExecCGI Order allow,deny Allow from all AllowOverride All </Directory> </VirtualHost>

相关文章
相关标签/搜索