之后我已经安装的虚拟主机{}解决了2.5 WAMP本地主机不工作,我得到403 Forbidden错误

问题描述:

我已经设置虚拟主机现在,当我键入本地主机它不工作,我想,现在我不得不做出对本地主机它的自我虚拟主机和它的工作,但现在当我输入我的外部IP它不工作它说,403禁止让我怎么解决这个问题我必须做一个虚拟主机为我的外部IP,它会为每个用户或只是我的电脑,例如工作,如果我给一个朋友,他输入我的外部IP将它的工作?

I have setup virtual hosts now when I type localhost it does not work I figured that now I'll have to make a virtual host for local host it self and it worked but now when I type my external ip it does not work it says 403 forbidden so how do i fix this do I have to make a virtual host for my external ip and will it work for everyone or just my computer for example if I give to a friend and he typed my external ip will it work?

在创建虚拟主机,Apache的忽视在httpd.conf即本地主机定义的主机。所以,你必须创建一个本地主机虚拟主机为好。

When you create Virtual Hosts, Apache ignored the host defined in httpd.conf i.e. localhost. So you have to create a vhost for localhost as well.

有关安全应该是第一个虚拟主机定义,好像有人只是试图您的IP地址,Apache将默认为第一个虚拟主机,这将是仅本地访问定义,他们将得到一个错误说你是不允许的。

For security it should be the first vhost defined, as if someone just tries your ip address, Apache will default to the first vhost and that will be defined with only local access and they will get an error saying you are not allowed in.

根据您的其他问题,您应该只允许访问您的 .TK 域,如果用户实际进入一个有效 xxx.tk 域名,并禁止访问,如果他们只是用你的广域网IP地址。

As per your other question, you should only be allowing access to your .tk domains if the user actually enters a valid xxx.tk domain name and disallow access if they just use your wan ip address.

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