Posts /

Configure SSL on Apache Server

Twitter Facebook Google+
13 Feb 2015

As a developer, you may want to enable SSL on your local Apache! If that is the case, then this post is for you. We are going to tweak some configurations of Apache Webserver in order to make SSL traffic get going.

Before we start, it is important that you have your private key and server certificate issued by your own CA, which are required because SSL works on public cryptography where certificates are exchanged to generate session keys. If you don’t have them, learn to generate them yourselves here. Remember to put the Common Name of the Certificate to “Localhost”, since you will be testing this locally.

/private/etc/apache2
LoadModule ssl_module libexec/apache2/mod_ssl.so
Include /private/etc/apache2/extra/httpd-ssl.conf

This will enable SSL module and will load its configurations from httpd-ssl.conf file. Now, save the httpd.conf file and exit the editor.

DocumentRoot /Path/to/root/folder
ServerName localhost
SSLCertificateFile /private/etc/apache2/SSLData/server.crt
SSLCertificateKeyFile /private/etc/apache2/SSLData/server.key
SSLCACertificatePath
SSLCARevocationPath
sudo apachectl restart

If everything went well, you should be able to see “https://localhost” working. If not :( then you can check the error log file located in “/var/log/apache2/error_log” or you can always comment your problems :).


Twitter Facebook Google+