博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
wamp You don't have permission to access / on this server等问题的解决.
阅读量:6899 次
发布时间:2019-06-27

本文共 1345 字,大约阅读时间需要 4 分钟。

原文:

安装完wamp之后,安装网上的教程设置虚拟路径,出现了问题,同样的问题由不同的原因导致。希望对有些大意的人有帮助。

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

2、httpd.conf中添加Listen 相应的端口,我的是8080

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

    <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>

4、然后调用localhost,就出现下面的错误:

Forbidden

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

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

5、最后发现是没有删掉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>

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

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

Forbidden

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

7、然后也是找了很多,多是说什么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>

转载地址:http://pgsdl.baihongyu.com/

你可能感兴趣的文章
Unity Shader 创建程序纹理贴图
查看>>
uGUI知识点剖析之AutoLayout
查看>>
Eclipse调试DEBUG时快速查看某个变量的值的快捷键
查看>>
C#的Compiler Error CS1660
查看>>
记录未预编译文件“*.aspx”,因此不能请求该文件的几种处理办法
查看>>
《大话设计模式》读书笔记-第15章 抽象工厂模式
查看>>
一个朋友
查看>>
转:汉字转拼音 - 输入汉字获取其拼音
查看>>
webservice(pers)
查看>>
hbase源码系列(十五)终结篇&Scan续集-->如何查询出来下一个KeyValue
查看>>
Linux学习总结(4)——Centos6.5使用yum安装mysql——快速上手必备
查看>>
Spring Boot学习总结(1)——Spring Boot入门
查看>>
C/C++ 宏带来的奇技淫巧 转载
查看>>
CocoaPods requires your terminal to be using UTF-8 encoding
查看>>
CSS3 圆角(border-radius)
查看>>
最大子数组
查看>>
用telnet命令,POP3接收邮件
查看>>
Nginx 关于 location 的匹配规则详解
查看>>
OutputStream、InputStream 、FileOutputStream、FileInputStream,字节流API
查看>>
10. Python面向对象
查看>>