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.
Command+shift+G
. Type this location in the dialog box:Once you are there create a folder “SSLData”.
Open httpd.conf
file in any text editor you are comfortable with(you may want to create its backup first, in case you mess things up). And uncomment te following lines (i.e remove # in front of them) :
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.
httpd-ssl.conf
located in “extra” folder. Again you may want to create its backup since you can mess things up.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 :).