问题
我试过并阅读过关于这个话题的各种问题,但都无法让它起作用。我试图使用虚拟主机访问与wamp使用的默认/www不同的文件夹。但我总是犯错误;
Forbidden
You don't have permission to access / on this server.
我完全可以访问本地主机和phpmyadmin,但不能访问我创建的任何虚拟主机。
httpd-vhosts.conf
# Virtual Hosts
#
# Required modules: mod_log_config
Listen 80
<VirtualHost *:80>
ServerAdmin admin@localhost.com
DocumentRoot "C:\Program Files (x86)\2. Apps\Wamp\www"
ServerName localhost
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@localhost.com
DocumentRoot "C:\Users\Chris\Documents\CBull Files\Projects\Tests"
ServerName test.lo
ServerAlias test.lo
<directory "C:\Users\Chris\Documents\CBull Files\Projects\Tests">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</directory>
主机
# Wamp Server Settings
127.0.0.1 localhost
127.0.0.1 test.lo
httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
谢谢
发布于 2013-04-04 11:25:04
谢谢大家的投入,有两个主要问题
c:/folder/folder with a space/wamp/
中有一个空格,因此我被告知这是不好的做法,如果有人知道为什么请告诉我。httpd.conf
中查找Listen 80
并更改为Listen 0.0.0.0:80
。再次,我不知道这是什么,所以如果有人知道,请张贴在下面。我希望这能帮到其他人。
发布于 2013-04-02 14:26:19
尝试将以下块替换为:
<VirtualHost test.lo:80>
ServerAdmin admin@localhost.com
DocumentRoot "C:\Users\Chris\Documents\CBull Files\Projects\Tests"
ServerName test.lo
ServerAlias test.lo
<directory "C:\Users\Chris\Documents\CBull Files\Projects\Tests">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</directory>
</VirtualHost>
我只做了一个改变:<VirtualHost *:80>
被<VirtualHost test.lo:80>
取代了。
注意:最后您丢失了</VirtualHost>
。
https://stackoverflow.com/questions/15644281
复制相似问题