Enabling SSL on MAC OS-X Snow Leopard

cd /private/etc/apache2/

openssl req -keyout privkey-$(date +%Y-%m).pem -newkey rsa:2048 -nodes -x509 -days 365 -out cert-$(date +%Y-%m).pem

Country Name (2 letter code) [AU]:CH
State or Province Name (full name) [Some-State]:Zurich
Locality Name (eg, city) []:Zurich
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Entropy
Organizational Unit Name (eg, section) []:Secure Server Administration
Common Name (eg, YOUR name) []:www.entropy.ch
Email Address []:liyanage@access.ch

Make sure to enter the sitename properly.

Make sure that TextEdit is not running, then type these lines into the terminal window:

chmod 600 privkey-YYYY-MM.pem

chown root privkey-YYYY-MM.pem

open -a TextEdit /etc/apache2/httpd.conf

Uncomment the lines –

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

open -a TextEdit /etc/apache2/extra/httpd-ssl.conf

Edit these lines –

  • # General setup for the virtual host
  • DocumentRoot “/Library/WebServer/Documents/new-ui/app/webroot”
  • ServerName http://www.gohachi.com:443
  • ServerAdmin mayank@hachilabs.com
  • SSLCertificateFile /etc/apache2/cert-YYYY-MM.pem
  • SSLCertificateKeyFile /etc/apache2/privkey-YYYY-MM.pem
Restart apache

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: