添加虚拟主机失败:拒绝访问错误403(XAMPP)(Windows 7中) [英] Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)
问题描述
我已经有了Windows 7中的XAMPP安装运行。
//本地主机和新的 Dropbox的:当我添加一个虚拟主机到的httpd-vhosts.conf,无论是常规 HTTP 。本地
不工作。
这是我加入到我的httpd-vhosts.conf:
<虚拟主机*:80>
的ServerAdmin postmaster@dummy-host.localhost
的DocumentRootE:/ Documenten / Dropbox的/ Dropbox的/伪htdocs目录
服务器名dropbox.local
ServerAlias www.dropbox.local
错误日志记录/ dropbox.local-error.log中
的CustomLog日志/ dropbox.local-access.log的组合拳
< /虚拟主机>
于是我抬起头来的任何信息我dropbox.local-error.log中:
[周四年2月2 10时41分57秒2012] [错误] [客户端127.0.0.1]客户端通过服务器配置否认:E:/ Documenten / Dropbox的/ Dropbox的/伪htdocs目录/
此错误似乎通过增加来解决。
<目录E:/ Documenten / Dropbox的/ Dropbox的/虚设的htdocs>
所有允许
< /目录>
但现在我得到dropbox.local-error.log中这个错误:
[周四年2月2 10时45分56秒2012] [错误] [客户:: 1]目录指数Options指令禁止:E:/ Documenten / Dropbox的/ Dropbox的/ dummy- htdocs中/
此外,当我试图访问的http://本地主机
,我没有得到任何错误在常规 error.log中
,虽然我得到的错误403
当我试图访问它。
任何人都可以帮助...它把我逼疯:•
编辑:
此外,在的httpd.conf
有如下(我已经看到了它提到多次,所以任何人说,前):
< IfModule dir_module>
的DirectoryIndex index.php文件index.pl index.cgi文件的index.asp index.shtml的index.html index.htm的\\
如default.php default.pl default.cgi的default.asp default.shtml default.html中的Default.htm \\
home.php home.pl home.cgi home.asp home.shtml home.html做为home.htm
< / IfModule>
解决方案 好吧:这是我现在没有和它的解决:
我的的httpd-vhosts.conf
看起来像现在这样:
<虚拟主机dropbox.local:80>
的DocumentRootE:/ Documenten / Dropbox的/ Dropbox的/伪htdocs目录
服务器名dropbox.local
错误日志记录/ dropbox.local-error.log中
的CustomLog日志/ dropbox.local-access.log的组合拳
<目录E:/ Documenten / Dropbox的/ Dropbox的/虚设的htdocs>
#设置AllowOverride所有#德precated
#订购允许,拒绝#德precated
#从pcated所有#德$ P $允许 这样做的 - 新#路
要求所有批准
< /目录>
< /虚拟主机>
首先,我看到有必要设置了<目录XX:XX>
选项。所以,我把<名录及GT; [..]< /目录>
双组分中的<虚拟主机> [..]< /虚拟主机>
。
在那之后,我加入的AllowOverride AuthConfig指数
到<目录方式>
选项
现在的http://本地主机
也指出,保管箱,虚拟主机。所以我加了 dropbox.local
到<虚拟主机*:80>
这使得它为 <虚拟主机dropbox.local:80>
最后,它的工作原理!:D
我是一个快乐的人! :):)
我希望其他人可以使用此信息。
I've got a XAMPP installation running on Windows 7.
As soon as I add a VirtualHost to httpd-vhosts.conf, BOTH the 'regular' http://localhost
AND the new dropbox.local
aren't working.
This is what I added to my httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "E:/Documenten/Dropbox/Dropbox/dummy-htdocs"
ServerName dropbox.local
ServerAlias www.dropbox.local
ErrorLog "logs/dropbox.local-error.log"
CustomLog "logs/dropbox.local-access.log" combined
</VirtualHost>
So I looked up my dropbox.local-error.log for any information:
[Thu Feb 02 10:41:57 2012] [error] [client 127.0.0.1] client denied by server configuration: E:/Documenten/Dropbox/Dropbox/dummy-htdocs/
This error seems to be solved by adding
<directory "E:/Documenten/Dropbox/Dropbox/dummy-htdocs">
Allow from all
</directory>
But now I get this error in dropbox.local-error.log:
[Thu Feb 02 10:45:56 2012] [error] [client ::1] Directory index forbidden by Options directive: E:/Documenten/Dropbox/Dropbox/dummy-htdocs/
Furthermore when I try to access http://localhost
, I dont get any error in the regular error.log
, although I get the error 403
when I try to access it.
Can anybody help... It's driving me mad :S
EDIT:
Also in httpd.conf
there is the following (I've seen it mentioned multiple times, so before anyone says it):
<IfModule dir_module>
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>
解决方案 Okay: This is what I did now and it's solved:
My httpd-vhosts.conf
looks like this now:
<VirtualHost dropbox.local:80>
DocumentRoot "E:/Documenten/Dropbox/Dropbox/dummy-htdocs"
ServerName dropbox.local
ErrorLog "logs/dropbox.local-error.log"
CustomLog "logs/dropbox.local-access.log" combined
<Directory "E:/Documenten/Dropbox/Dropbox/dummy-htdocs">
# AllowOverride All # Deprecated
# Order Allow,Deny # Deprecated
# Allow from all # Deprecated
# --New way of doing it
Require all granted
</Directory>
</VirtualHost>
First, I saw that it's necessary to have set the <Directory xx:xx>
options. So I put the <Directory > [..] </Directory>
-part INSIDE the <VirtualHost > [..] </VirtualHost>
.
After that, I added AllowOverride AuthConfig Indexes
to the <Directory>
options.
Now http://localhost
also points to the dropbox-virtualhost. So I added dropbox.local
to <VirtualHost *:80>
which makes it as <VirtualHost dropbox.local:80>
FINALLY it works :D!
I'm a happy man! :) :)
I hope someone else can use this information.
这篇关于添加虚拟主机失败:拒绝访问错误403(XAMPP)(Windows 7中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!