User Tools

Site Tools


guides:install:self-signed_ssl_certificates_for_ubuntu_apache

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

guides:install:self-signed_ssl_certificates_for_ubuntu_apache [2016/04/16 18:12] (current)
michaelc created
Line 1: Line 1:
 +====== How To: Create self-signed SSL Certificates for Ubuntu Apache ======
 +
 +Install apache2
 +<​code>​
 +sudo apt-get update
 +sudo apt-get install apache2
 +</​code>​
 +
 +Activate SSL Module
 +
 +<​code>​
 +sudo a2enmod ssl
 +sudo service apache2 restart
 +</​code>​
 +
 +Create a Self-Signed SSL Certificate
 +
 +<​code>​
 +sudo mkdir /​etc/​apache2/​ssl
 +sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /​etc/​apache2/​ssl/​apache.key -out /​etc/​apache2/​ssl/​apache.crt
 +</​code>​
 +
 +Configure Apache to use SSL
 +
 +<​code>​
 +sudo vi /​etc/​apache2/​sites-available/​default-ssl.conf
 +</​code>​
 +
 +
 +Add the following to the default-ssl.conf
 +
 +<​code>​
 +<​IfModule mod_ssl.c>​
 +    <​VirtualHost _default_:​443>​
 +        ServerAdmin admin@example.com
 +        ServerName your_domain.com
 +        ServerAlias www.your_domain.com
 +        DocumentRoot /​var/​www/​html
 +        ErrorLog ${APACHE_LOG_DIR}/​error.log
 +        CustomLog ${APACHE_LOG_DIR}/​access.log combined
 +        SSLEngine on
 +        SSLCertificateFile /​etc/​apache2/​ssl/​apache.crt
 +        SSLCertificateKeyFile /​etc/​apache2/​ssl/​apache.key
 +        <​FilesMatch "​\.(cgi|shtml|phtml|php)$">​
 +                        SSLOptions +StdEnvVars
 +        </​FilesMatch>​
 +        <​Directory /​usr/​lib/​cgi-bin>​
 +                        SSLOptions +StdEnvVars
 +        </​Directory>​
 +        BrowserMatch "MSIE [2-6]" \
 +                        nokeepalive ssl-unclean-shutdown \
 +                        downgrade-1.0 force-response-1.0
 +        BrowserMatch "MSIE [17-9]"​ ssl-unclean-shutdown
 +    </​VirtualHost>​
 +</​IfModule>​
 +</​code>​
 +
 +Activate apache ssl virtual host
 +
 +<​code>​
 +sudo a2ensite default-ssl.conf
 +sudo service apache2 restart
 +</​code>​
  
guides/install/self-signed_ssl_certificates_for_ubuntu_apache.txt · Last modified: 2016/04/16 18:12 by michaelc