Apache2 ssl windows
October 12th, 2008To enable https for your site using VirtualHost follow the following steps.
- Download Apache 2.2.9 with openssl (MSI Installer) from http://httpd.apache.org/download.cgi
- Execute the installer and follow the instructions.
- Make sure Apache is installed properly by pointing your web browser to http://127.0.0.1/ or http//localhost/.
- If you are using default Apache installation directory, navigate to c:\program files\apache software foundation\apache2.2\conf.
- Execute:
openssl req -config openssl.cnf -new -out domainname.csr -keyout domainname.pem
to create a .pem key. - Execute:
openssl rsa -in domainname.pem -out domainname.key
to create a .key key. - Delete .rnd file.
- Execute:
openssl x509 -in domainname.csr -out domainname.cert -req -signkey domainname.key -days 365
to create .cert key. - Create a directory called ssl in the conf directory. Move all keys (cert,csr,key,pem) to the newly created directory.
- Edit httpd.conf.
- Uncomment line that says:
LoadModule ssl_module modules/mod_ssl.so. - Uncomment line that says:
Include conf/extra/httpd-ssl.conf - Edit extra\httpd-ssl.conf.
- Under directive <VirtualHost _default_:443>, edit DocumentRoot and ServerName to reflect your site name.
- Point SSLCertificateFile to conf/ssl/domainname.cert
- Point SSLCertificateKeyFile to conf/ssl/domainname.key
- Modify options under <Directory> directives as required.
To know more about what each command does refer to http://www.neilstuff.com/apache/apache2-ssl-windows.htm.