SSL Configuration

The previous sections introduced the (not-so-basic) concepts behind SSL, and you have learned how to generate keys and certificates. Now you can configure Apache to support SSL. The mod_ssl module must either be compiled statically or, if you have compiled as a loadable module, the appropriate LoadModule directive must be present in the file.

Next, you can add the following configuration snippet to your Apache configuration file:

Listen 443
<VirtualHost _default_:443>
ServerName www.example.com
SSLEngine on
SSLCertificateFile \
/usr/local/ssl/openssl/certs/www.example.com.cert
SSLCertificateKeyFile \
/usr/loca/ssl/openssl/certs/www.example.com.key
</VirtualHost>

This snippet sets up a new virtual host that will listen to port ...

Get Sams Teach Yourself PHP, MySQL® and Apache All in One now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.