Apart from its ubiquity, Apache is very handy to simulate and test network conditions.
Like recently, I had to work with two local Secure Socket Layer (SSL) web servers, i.e, servers which can be accessed only by "https://URL". The servers using SSL protocol are different from conventional HTTP protocol for they operate on port 443 instead of port 80 (for http), and are by design more secure.
Configuring Apache2 is straight forward, and I was already running it on my system. To get it serve content on port 443 (SSL), I had to perform a few simple steps.
(Presumptions: Apache2 is already configured and running on a Debian based Linux machine)
(You should perform all these operations as root/ or perform as sudo as shown below)
1. Creating self-signed certificates for SSL
* Install ssl-cert package, if not installed already. In Debian based machines
raghu@fossphosis$ sudo apt-get install ssl-cert
* Creating a default self-signed certificate, in the default directory /etc/ssl/certs
raghu@fossphosis$ sudo make-ssl-cert generate-default-snakeoil --force-overwrite
2. Enabling the locations which can be accessed by clients on SSL
To use the default option, perform
raghu@fossphosis$ sudo a2ensite default-ssl
This lets users access content from /var/www on SSL
3. Enabling SSL module itslef for Apache2
raghu@fossphosis$ sudo a2enmod ssl
4. Finally, restart Apache2 server for the changes to take place
raghu@fossphosis$ sudo /etc/init.d/apache2 restart
5. Test it by requesting for a https URL in your browser
https://localhost/
SSL Error - Google Chrome |
https:--localhost - Google Chrome |
Way to go with a tech blog, Maverick :) Keep it going :)
ReplyDelete