You are on page 1of 2

Enabling and configuring SSL for apache 2.

2 under windows WAMP server2

Generate a Private Key and CSR

First you need to generate an RSA Private Key and Certificate Signing Request (CSR)
openssl genrsa -des3 -out myserver.key 1024

Next, we need to remove the pas phrase from the key to that the server does pause to request it.. which would be a bit annoying !
openssl rsa -in myserver.key -out myserver.pem

we need to generate the CSR like so:

openssl req -new -key myserver.key -out myserver.csr -config c:\\wamp\\bin\\apache\\apache2.2.6\\conf\\openssl.cnf

Generating a Self-Signed Certificate

To generate a temporary certificate which is good for 365 days, use the following command:
openssl x509 -req -days 365 -in myserver.csr -signkey myserver.key -out myserver.crt

Create an directory under: C:\\wamp\\bin\\apache\\apache2.2.6\\conf\\ssl and move the myserver.key and myserver.cert into it.

Configure Apache to use SSL

Edit the http.conf file via WAMPs menu or directly here: C:\\wamp\\bin\\apache\\apache2.2.6\\conf\\httpd.cnf Locate the line
Listen 80

And make it also listem on the standard ssl port 443

Listen 80 Listen 443

Now create a new virtual host like so (in addition to any normal port 80 entries): This has a complete symfony setup up too FYI
<VirtualHost *:443> ServerName neubreed.localhost DocumentRoot "/home/neubreed/web" DirectoryIndex index.php Alias /sf c:\\wamp\\bin\\php\\php5.2.5/PEAR/data/symfony/web/sf <Directory "c:\\wamp\\bin\\php\\php5.2.5\\PEAR/data/symfony/web/sf"> AllowOverride All Allow from All </Directory> <Directory "/home/neubreed/web"> AllowOverride All Allow from All </Directory> # These are the actual SSL directives needed to get it all working! SSLEngine on SSLCertificateFile C:/wamp/bin/apache/apache2.2.6/conf/ssl/myserver.crt SSLCertificateKeyFile C:/wamp/bin/apache/apache2.2.6/conf/ssl/myserver.pem </VirtualHost>