I'm new to SSL. I set it up on my CentOS 5 system running Apache 2.2.3-65. It appears to be working -- a can browse my site and the https protocol is displayed in the address bar.
Here's my SSL vhost config. Does it look OK? Did I make any major errors?
The intention is for all traffic for this particular site to be encrypted, so there's no vhost for port 80, just this one.
<VirtualHost *:443>
ServerName www.mydomain.com
ServerAlias mydomain.com
DocumentRoot "/opt/deployed_rails_apps/my_app/current/public"
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/www.mydomain.com.crt
SSLCertificateKeyFile /etc/pki/tls/certs/www.mydomain.com.pem
SSLCACertificateFile /etc/pki/tls/certs/www.mydomain.com.ca-bundle
ErrorLog "logs/mydomain.com-ssl-error_log"
CustomLog "logs/mydomain.com-ssl-access_log" common
CustomLog "logs/mydomain.com-ssl-deflate_log" deflate
<Directory "/opt/deployed_rails_apps/rock_pebble/current/public">
Options -MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</Virtualhost>
That will work, certainly. But here are a few more options that you should include for better security:
You should also check your server security against SSL Pulse and see their SSL Best Practices Guide. There's also an SSL Rating Guide which explains why these options are a good idea.
Looks fine, but remove the
ServerAlias
directive unless your cert will work on both "www.example.com" and "example.com".