[英]Wamp 2.5 local host doesn't work after I have setup virtual hosts I get 403 forbidden error
当我键入localhost时,我现在已经设置了虚拟主机,它不起作用。我想现在我必须为它自己的本地主机创建一个虚拟主机,它可以工作,但是现在当我键入外部ip时,它不起作用,它说403禁止,所以我该如何解决这个问题,我必须为我的外部IP创建一个虚拟主机,并且它对所有人或仅对我的计算机都有效,例如,如果我给一个朋友并且他输入我的外部IP会起作用吗?
创建虚拟主机时,Apache会忽略httpd.conf中定义的主机,即localhost。 因此,您还必须为本地主机创建一个虚拟主机。
为了安全起见,它应该是定义的第一个虚拟主机,就像有人只是尝试使用您的IP地址一样,Apache将默认使用第一个虚拟主机,并且将仅通过本地访问进行定义,并且他们会收到一条错误消息,指出不允许您进入。
根据您的其他问题,仅当用户实际输入有效的xxx.tk
域名时,才应允许访问.tk
域;如果用户仅使用wan ip地址,则不允许访问。
# Should be the first VHOST definition so that it is the default virtual host
# Also access rights should remain restricted to the local PC and the local network
# So that any random ip address attack will recieve an error code and not gain access
<VirtualHost *:80>
ServerAdmin webmaster@homemail.net
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
<IfDefine APACHE24>
Require local
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from 127.0.0.0 localhost ::1
</IfDefine>
</Directory>
</VirtualHost>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.