After self-signing an SSL certificate for development purposes the Web server needs to be configured appropriately. I found the posting by Dave Kiss to be the best one. Following are the required steps if you used the default MAMP settings:
- Backup your configuration files:
- Open a terminal window.
- Go to the Apache configuration folder:
cd /Applications/MAMP/conf/apache - Backup the Apache configuration file:
cp httpd.conf httpd.conf.bak - Backup the SSL configuration file:
cp extra/httpd-ssl.conf extra/httpd-ssl.conf.bak
- Update the Apache configuration file:
- Open the configuration file using an editor of your choice:
nano httpd.conf - Search for the line containing httpd-ssl.conf:
Press Ctrl-W then type httpd-ssl.conf - Uncomment the line by removing the # from the beginning such that it reads:
Include /Applications/MAMP/conf/apache/extra/httpd-ssl.conf - Save and exit:
Press Ctrl-X the Y
- Open the configuration file using an editor of your choice:
- Copy the server.key and server.crt file to your Apache configuration folder.
- Start the servers through the MAMP interface.
- Navigate to your site through a browser using https:
https://localhost
N.B. If the apache server fails to start then you have an error in your configuration, make sure you replace the DocumentRoot in your SSL configuration file to match your actual root folder.
N.B. Dave’s post also contains steps to configure Virtual Hosts which I left out for a different posting to be less confusing.
N.B. Dave’s post using git to backup the files, in this post I simply make a copy of the configuration file, if you want to restore the backup simply type: cp httpd.conf.bak httpd.conf or any other file you want to restore.
Hello there, simply become alert to your weblog through Google, and found that it is truly informative. I’m going to be careful for brussels. I will be grateful when you continue this in future. Lots of other folks shall be benefited from your writing. Cheers!