noizZze

Apache 2 and SSL Configuration

Today while playing with Amazon EC2 I installed Apache httpd 2.2.15 and discovered that previously working SSL module configuration no longer works. The server doesn’t start and the error log has this:

1
[Sun Oct 03 16:37:04 2010] [error] Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile] ((null):0)

I know for sure that the configuration I have worked, but for some reason it stopped. Instead of downgrading I decided to find the truth.

It appears the newer version of httpd has stricter SSL configuration rules. Now you must have SSLCertificateFile and SSLCertificateKeyFile options in your VirtualHost definitions, so they should look like this:

1
2
3
4
5
6
<virtualhost *:443>
  ...
  SSLEngine on
  SSLCertificateFile /etc/pki/tls/certs/localhost.crt
  SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
</virtualhost>

Hope it helps as I see tens and hundreds of posts from people everywhere puzzling over this.