【问题标题】:Getting 403 forbidden error on WAMP server when usng SSL使用 SSL 时在 WAMP 服务器上出现 403 禁止错误
【发布时间】:2012-02-23 13:01:40
【问题描述】:

我最近花了 4 个小时试图让 SSL 在我的本地开发 wamp 服务器(Windows 7)上运行。

现在一切似乎都设置好了,服务器重新启动至少没有任何错误!!

我似乎无法解决的唯一问题是当我尝试通过 HTTPS (SSL 443) 访问我的网站时出现 403 禁止。它在端口 80 上运行良好,只是在 443 上运行良好。 错误日志显示如下

[error] [client 127.0.0.1] client denied by server configuration: F:/My Webs/freedate/public_html/

我的 http.conf 文件添加了以下虚拟主机

<VirtualHost *:80>
    ServerName www.freedate.local
    ServerAlias freedate.local *.freedate.local
    DocumentRoot "F:\My Webs\freedate\public_html"

    <Directory "F:\My Webs\freedate\public_html">
        allow from all
        order allow,deny
        # Enables .htaccess files for this site
        AllowOverride All
    </Directory>
    DirectoryIndex index.html index.php
</VirtualHost>

我的 httpd-ssl.conf 添加了以下虚拟主机

<VirtualHost *:443>
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile "C:/wamp/bin/apache/Apache2.2.21/conf/ssl/server.crt"
    SSLCertificateKeyFile "C:/wamp/bin/apache/Apache2.2.21/conf/ssl/server.key"

    ServerName www.freedate.local
    ServerAlias freedate.local *.freedate.local
    DocumentRoot "F:\My Webs\freedate\public_html"

    <Directory "F:\My Webs\freedate\public_html">
        Options -Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    DirectoryIndex index.html index.php
</VirtualHost>

如果有人能发现我做错了什么,我将不胜感激,非常感谢。

亲切的问候 加里

【问题讨论】:

    标签: ssl wamp wampserver


    【解决方案1】:

    虽然这是一个非常古老的问题,但我今天遇到了同样的问题,我在这里为将来遇到此问题的任何人提供解决方案。

    如果在没有 SSL 的情况下一切正常,此解决方案应该可以工作。您可以在这里找到不使用 SSL 的帮助:https://stackoverflow.com/a/14671738/2407971

    httpd-ssl.conf 文件中,在&lt;VirtualHost _default_:443&gt;&lt;/VirtualHost&gt; 代码块之间,您会发现如下内容:

    <Directory "c:/Apache24/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>
    

    在这些行之后,插入以下代码:

    <Directory  "c:/wamp64/www/">
        #Options FollowSymLinks
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
    <Directory  "c:/wamp64/www/yoursite/">
        #Options FollowSymLinks
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
    

    这将基本上允许 www 文件夹的根目录和您的站点可以在 SSL 中访问。

    重新启动服务器并测试您的站点。

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-18
      • 2013-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-14
      • 2018-02-06
      • 1970-01-01
      相关资源
      最近更新 更多