Configue SSL in Apache 2.2 on MS Windows

Following are the steps to configure the Apache 2.2 on the windows machine.

1) Download and install apache 2.2 from here
2) Follow the below instructions,

  • Open Command prompt and browse to ~Apache2.2/bin directory.
  • Type, openssl req -config ../conf/openssl.cnf -new -out ssl_cert.csr -keyout ssl_cert.pem
    • System will ask for the details about the certificate. 
    • Fill out all the information but,
      • Make sure that you remember the entered PEM pass phrase.
      • Common name should be the domain name that you will use this certificate on.
  • Type, openssl rsa -in ssl_cert.pem -out ssl_cert.key
    • You will be asked to enter the earlier entered PEM pass phrase.
    • It should display "writing RSA key" output.
  • Type, openssl x509 -in ssl_cert.csr -out ssl_cert.crt -req -signkey ssl_cert.key -days 365
    • 365 is the no. of days till the certificate is valid.
  • Keep, ssl_cert.key & ssl_cert.csr file at separate location ("C:\SSL_certificates\" folder) and you can delete remaining file.
  • Browse through ~Apache2.2/conf directory and open httpd.conf file.
  • Search "#LoadModule ssl_module modules/mod_ssl.so" line and un-comment the same (remove # from the beginning).
  • Search "#Include conf/extra/httpd-ssl.conf" and un-comment the same.
  • Browse through ~Apache2.2/conf/extra directory and open httpd-ssl.conf file.
    • Search "#Listen 443" line and un-comment the same.
    • Search "#SSLCertificateFile" line and add above that line SSLCertificateFile "C:/SSL_certificates/ssl_cert.crt". Provided you have kept the file at the given location.
    • Search "#SSLCertificateKeyFile" line and add above that line SSLCertificateKeyFile "C:/SSL_certificates/ssl_cert.key".
  • That's it! Now you can restart apache 2.2 and you should be able to access the application on HTTPS.

Comments

Popular posts from this blog