【问题标题】:Set up WAMP server - getting 403设置 WAMP 服务器 - 获取 403
【发布时间】:2013-09-28 21:20:12
【问题描述】:

我想把我的网站放到网上。我正在使用 WampServer 2.2。现在,我将 wamp 设置如下:

<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 端口。现在,当我尝试打开 localhost:81 时,我的网页可以正常打开。但是,当我尝试使用我的外部 IP 地址 176.xxx.xxx.xxx:81 访问它时,我收到 403 Forbidden 错误。我在 Apache 访问日志中看到了这些请求,所以我猜这部分设置得很好,但我一定错过了 Apache 配置。

编辑:“上线”选项已激活。

有什么有用的想法吗?

【问题讨论】:

标签: apache wamp apache-config


【解决方案1】:

好的,试试这个,你没有指定你使用的是哪个版本的 Apache,而且你似乎把 Apache 2.2 的语法和 Apache 2.4 的语法混在一起了,所以我给出了两个版本。

将此部分改回原来的样子,这控制了对您的 C:\ 的访问,而您只是允许完全访问它,这不好。

来自

<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 有什么好处,它只会让外部用户的生活变得更加复杂。

【讨论】:

    猜你喜欢
    • 2012-01-25
    • 2015-04-18
    • 2013-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-21
    • 1970-01-01
    相关资源
    最近更新 更多