2013-09-23 91 views
1

我想让我的网站在线。我正在使用WampServer 2.2。现在,我已经设置了wamp如下:设置WAMP服务器 - 获取403

<Directory /> 
    AllowOverride All 
    Options All 
    Require all granted 
    Order allow,deny 
</Directory> 

Listen 81 
<VirtualHost *:81> 
    ServerName rti.etf.rs 
    DocumentRoot "C:/wamp/www" 
    DirectoryIndex index.php 
</VirtualHost> 

我已经在Windows防火墙中打开了端口81。现在,当我尝试打开本地主机时:81我的网页打开良好。但是,当我尝试使用我的外部IP地址176.xxx.xxx.xxx:81访问它时,出现403 Forbidden错误。我在Apache访问日志中看到了这些请求,所以我猜这部分设置得很好,但我必须错过Apache配置。

编辑:放置在线选项被激活。

任何有帮助的想法?

+0

把网上菜单选项? http://imgur.com/xGago或你见过这个问题:http://stackoverflow.com/questions/5657279/make-wamp-www-available-on-local-network –

+0

哦,我忘了写我我的服务器也上线了。 – Banana

回答

1

OK试试这个,你没有指定你使用的是哪个版本的Apache,你似乎已经将Apache 2.2语法与Apache 2.4语法混合在一起,所以我给出了两个版本。

将此部分更改回原来的样子,这将控制对您的C:\的访问,并且您只允许对其进行完全访问,而不是GOOD。

<Directory /> 
    AllowOverride All 
    Options All 
    Require all granted 
    Order allow,deny 
</Directory> 

到 的Apache 2.2.x的语法

<Directory /> 
    Options FollowSymLinks 
    AllowOverride None 
    Order Deny,Allow 
    Deny from all 
</Directory> 

Apache2.4.x语法

<Directory /> 
    Options FollowSymLinks 
    AllowOverride None 
    Require all denied 
</Directory> 




我们您的虚拟主机。这也需要在块内部指定它自己的安全性

Listen 81 
<VirtualHost *:81> 
    ServerName rti.etf.rs 
    DocumentRoot "C:/wamp/www" 
    DirectoryIndex index.php 
#### Apache 2.2 syntax 
    <Directory "C:/wamp/www/"> 
    AllowOverride All 
    Order Allow,Deny 
    Allow from all 
    </Directory> 
#### Apache 2.4 syntax 
    <Directory "C:/wamp/www/"> 
    AllowOverride All 
    Require all granted 
    </Directory> 
</VirtualHost> 

PS。 我无法看到使用端口81的好处,它只会让外部用户的生活变得更加复杂。