Lovingly skimmed from this guide
- Find your local host name, and hang onto it for later use
$ hostname
- Create a self-signed SSL cert:
openssl req -new -x509 -days 365 -sha1 -newkey rsa:1024 -nodes \
-keyout server.key -out server.crt -subj \
'/O=Company/OU=Department/CN=[Your Hostname here]'
- Make server.* root readable, and move them to your apache config directory:
chmod 600 server.*
mv server.* /your/apache/conf/dir
- Add the following to your Apache hosts file:
LoadModule ssl_module modules/mod_ssl.so
Listen 443
ServerName [Your Hostname here]
- Add a vhost for each site you'll be working with:
<virtualhost *:443>
SSLEngine on
SSLCertificateFile "/your/apache/conf/dir/server.crt"
SSLCertificateKeyFile "/your/apache/conf/dir/server.key"
DocumentRoot /Users/dev/Sites/[site name]
ServerName local.[site name].com
ErrorLog /Users/dev/Sites/log/[site name]_error_log
</virtualhost>
Understandably, given my preferences, this is gonna work best with ✨MacPorts✨. Let me know if you guys try this with any other package management systems.