Setup and Redirecting to SSL - Self Signed Cert


Good article on setting up SSL on apache server.

To forward everything to SSL site here is a good article on setting up apache for redirect to SSL.
Followed the steps and it worked as expected.

Down n dirty

Add Module:
sudo a2enmod ssl
sudo service apache2 restart
Create Cert dir:
sudo mkdir /etc/apache2/ssl
Generate Cert
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

Respond to prompts
New York City

Next update the SSL config file by adding admin stuff

and so that it points to the cert files.
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

Also make sure all cgi directories point to where they should if you had updated the default conf file

Enable SSL
sudo a2ensite default-ssl.conf

restart apache2
sudo service apache2 restart
watch for any errors, they will stand out, like if you mispelled the cert name.. haha
Aug 04 08:29:41 wmtpi3 apachectl[13204]: SSLCertificateFile: file '/etc/apache2/ssl/' does not exist or is empty

Update apache conf to forward port 80 if you'd like with the instructions above.
Basically it adds this after the document root:
Redirect permanent / https://server

Message you will see without a CA cert