2012-01-31 77 views
4

我剛剛花了最近4個小時試圖讓SSL在我的本地開發人員wamp服務器(Windows 7)上工作。當使用SSL時,在WAMP服務器上獲得403禁止的錯誤

一切似乎現在安裝好了,以及服務器重新啓動至少沒有任何錯誤!

當我嘗試通過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> 

如果任何人都可以發現我做錯了什麼,我會非常感激,非常感謝。

親切的問候 加里

回答

1

雖然這是一個非常古老的問題,我今天所面臨的同樣的問題,我在這裏給解決方案的人在未來面臨這個問題。

如果一切工作都沒有SSL,此解決方案應該可以正常工作。你可以找到幫助沒有SSL在這裏工作:https://stackoverflow.com/a/14671738/2407971

httpd-ssl.conf文件時,<VirtualHost _default_:443></VirtualHost>代碼塊之間,你會發現這樣的事情:

<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文件夾和yoursite的根目錄在SSL中可訪問。

重新啓動服務器並測試您的網站。

希望它有幫助。