Configuring Apache for HTTPS

From Zanecorpwiki

Jump to: navigation, search
  1. get an SSL cert
  2. copy cert to '~/build/ymake/modules/apache/ssl/certs'
  3. configure the server and restart apache

Example config (including non-ssl)

<VirtualHost 192.168.0.1:42069>
        ServerAdmin webmaster@foo.com
        DocumentRoot /home/hostuser/sites/com/foo
        ServerName www.foo.com
        ErrorLog logs/foo.com-error_log
        CustomLog logs/foo.com-access_log combined
</VirtualHost>
<VirtualHost 192.168.0.1:42070>
        ServerAdmin webmaster@foo.com
        DocumentRoot /home/hostuser/sites/com/foo
        ServerName www.foo.com
        ErrorLog logs/secure.foo.com-error_log
        CustomLog logs/secure.foo.com-access_log combined
        SSLEngine on
        SSLCipherSuite SSLv2:SSLv3:TLSv1:+HIGH:+MEDIUM
        SSLCertificateFile /home/hostuser/build/ymake/modules/apache/ssl/certs/www_foo_com.crt
        SSLCertificateKeyFile /home/hostuser/build/ymake/modules/apache/ssl/private/apachekey.pem
</VirtualHost>

Of course, adjust the IP address, server admin, document root, server name, error log, and SSL cert and key locations.

(TODO: look into this more, this is according to notes that don't have any reference.) Apache servers are either SSL or not. That's why it's important to use the virtual host approach--so that you can support SSL and non-SSL connections from the same server process.

Personal tools