Minimal Apache Configuration


Once you have generated your keys and certificates, either self-signed or certified by a third-party CA, the next step is to configure Apache. As part of the installation process, mod_ssl creates a sample SSL configuration. Apache 1.3 adds it to the default httpd.conf file and Apache 2.0 includes a separate ssl.conf file, referenced by an Include directive in httpd.conf. The myriad configuration options can be confusing, but in reality there are only a few options that you need to configure, as shown in the following listing:

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


One of the Listen directives tells Apache to listen at the default HTTPS port, 443. SSLEngine On enables SSL for that particular host and the SSLCertificateFile and SSLCertificateKeyFile directives point to the certificate and private key.




Apache(c) Phrase Book(c) Essential Code and Commands
Apache Phrasebook
ISBN: 0672328364
EAN: 2147483647
Year: 2006
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net