Monday, July 26, 2004

Quick and Dirty Apache 2.0.48 –SSL-mod_ssl

• Download compile mod_ssl source distribution from http://rab.members.easyspace.com/apache-ssl/apache-ssl-2.0.48-(openssl-0.9.7d).zip• Unzip it and place file in following manner
o openssl.exe, libeay32.dll, ssleay32.dll in /bin directory
o mod_ssl.so in /modules directory
o ssl.conf in /conf directory
o openssl.cnf in /bin directory (this one is only needed if you want to create test site certificate; if you are buying certificate from CA then you will not need this. )
• Open /conf httpd.conf file and add following
o LoadModule ssl_module modules/mod_ssl.so
(Sometimes it’s already present in httpd.conf, in that case just uncomment the line)
• Make sure following block is present in httpd.conf
o
o Include conf/ssl.conf
o

(This will load ssl.conf when mod_ssl module is loaded, above block is usually present in default httpd.conf)
• Open ssl.conf and make sure server paths are correct in the file, especially
o DocumentRoot
o Server name
o Server admin
• Go to /bin and execute following to create self-signed server certificate. Answer questions accordingly, “Common name” will be the site name e.g. www.myworld.com
o openssl.exe req -config openssl.cnf -new -nodes -out server.csr -keyout server.key
o openssl.exe x509 -in server.csr -out server.crt -req -signkey server.key -days 365 -set_serial 1
(Increment the serial number each time you create a certificate.)
• Move files "server.key" and "server.crt" to your apache2\conf folder. Delete files ".rnd" and "server.csr".
• Start Apache. Assuming it starts ok; test it with your preferred web browser.
• Point to https://localhost/myworld
• Now you are SSL enabled.

No comments: