Set Up HTTPS/SSL with Apache2.2 for Windows

First, make sure you’re downloading the Apache from http://httpd.apache.org/download.cgi and choosing the Win32 Binary including OpenSSL.

After installing the Apache, by default your Apache will be located at “C:/Program Files/Apache Software Foundation/Apache2.2″. Then open your “conf/httpd.conf” because in this post we will play just with this configuration file. First, search for “LoadModule ssl_module modules/mod_ssl.so” make sure there is no comment (#) in front of that line. This step will enable your server to accept HTTPS request.

...
#LoadModule speling_module modules/mod_speling.so
LoadModule ssl_module modules/mod_ssl.so
#LoadModule status_module modules/mod_status.so
...

Next, because of HTTPS/SSL connection by default using port 443 so we must set the apache to listen port 443.

...
#Listen 12.34.56.78:80
Listen 80
Listen 443
...

Preparation almost complete. The final step is creating the virtual host for HTTPS/SSL request. And don’t forget to create the SSL certificate that the instruction can be found in this blog too. Make sure that your CN (Common Name) use the URL that you’ll use for the request. Because your certificate will be labeled as an identity theft if the CN not equal with the URL.

With Mozilla Firefox 3+ : “Certificate belongs to a different site, which could indicate an identity theft

With Internet Explorer 8 : “The security certificate presented by this website was issued for a different website’s address



...
<VirtualHost *:443>
	ServerName home.imkrisna.com
	ServerAdmin im.krisna@gmail.com

	DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

	SSLEngine on
	SSLCertificateFile "C:/SSLCert/home.imkrisna.com.crt"
	SSLCertificateKeyFile "C:/SSLCert/home.imkrisna.com.key"

</VirtualHost>
...

Leave a Reply

Your email address will not be published. Required fields are marked *

Post Navigation