Apache with HTTPs
Basic idea
(https://help.ubuntu.com/community/forum/server/apache2/SSL)
- setup ssl ceritifcates
- you can use apache_ssl_certificate (some newer version of ubuntu are missing this, see below)
-
$sudo apache2-ssl-certificate -days 365
- enable mod_ssl
-
$sudo a2enmod
-
- Listen to port 443
- add ‘Listen 443′ to ports.conf (without the quotes)
- setup a apache site under sites-available
- make a copy the sites-available/default to sites-available/ssl
- modify available-sites/default
-
NameVirtualHost *:80
-
<virtualhost *:80>
-
- modify available-sites/ssl
-
NameVirtualHost *:443
-
<virtualhost *:443>
-
SSLEngine On
-
SLCertificateFile /etc/apache2/ssl/apache.pem
-
- enable the ssl site
-
sudo a2ensite ssl
-
- setup rewrite rules for any of the pages that you want to be accessed always by ssl; include these rules in default site
- for example if you want your bugzilla page to go to https
- RewriteEngine on
- RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^/bugzilla(.*)$ https://%{SERVER_NAME}/bugzilla$1 [L,R]
Instructions
apache2-ssl-certifcate not found
- the apache2-ssl-certificate and other reqd files are not found in Fiesty and some other distributions
- the bug that discusses this is here https://bugs.launchpad.net/debian/+source/apache2/+bug/77675
- they discuss what can be done and one of them suggests using steps given in mod ssl docs directly; the link for mod-ssl docs is below
Links from which info was compiled
- https://help.ubuntu.com/community/forum/server/apache2/SSL
- http://ubuntuforums.org/archive/index.php/t-4466.html
- discusses apache and apache2; you can find apache2 if you scroll down
- http://www.linode.com/wiki/index.php/Apache2_SSL_in_Ubuntu#Apache2_SSL
- http://www.modssl.org/docs/2.8/ssl_faq.html#ToC28
- mod ssl docs -lots of information; was mentioned in a ubuntu bug-report
- http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html