Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting 403 forbidden error on WAMP server when usng SSL

I have just spent the last 4 hours trying to get SSL working on my local devolopment wamp server (windows 7).

Everything seems to be setup ok now, well the server restarts without any errors at least!!

The only issue I can not seem to solve is a 403 forbidden when I try to access my site through HTTPS (SSL 443). It works fine on port 80, just not on 443. The error log shows the following

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

My http.conf file has the following vhost added

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

And my httpd-ssl.conf has the following vhost added

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

If anyone can spot what I am doing wrong I would be most grateful, many thanks.

Kind regards Garry

like image 500
Garry Avatar asked Jan 31 '12 19:01

Garry


1 Answers

Although this is a very old question, I faced the same issue today and I am giving the solution here for anyone facing this issue in the future.

This solution should work if everything is working without SSL. You can find help working without SSL here: https://stackoverflow.com/a/14671738/2407971

In the httpd-ssl.conf file, between the <VirtualHost _default_:443> and </VirtualHost> code blocks, you will find something like this:

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

After these lines, insert the following code:

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

This will basically allow the root directory of the www folder and yoursite to be accessible in SSL.

Restart the server and test your site.

Hope it helps.

like image 69
Placid Avatar answered Oct 12 '22 16:10

Placid