Configuring Apache2.0 to use SSL

I followed this site to get the basics up and running, in particular how to generate self-signed certificates: Raible’s Wiki: ApacheSSL

The actual configuration of my Virtual Hosts in the httpd.conf file was more trial and error. There is plenty of info about not mixing name and ip based Vitual Hosts, but I couldn’t find a good working example. It turns out that this configuration works fine:

<code>
NameVirtualHost x.x.x.x:80

#Use SSL for this Virtual Host
&lt;VirtualHost x.x.x.x:443&gt;
   SSLEngine On
   SSLCertificateFile /path_to/server.crt
    SSLCertificateKeyFile /path_to/server.key
    DocumentRoot /doc_root_for_ssl_protected_files
    ServerName server.name.com
&lt;/VirtualHost&gt;

&lt;VirtualHost x.x.x.x:80&gt;
    DocumentRoot /doc_root_for_files_on_port_80/
    ServerName otherserver.server.com
    DirectoryIndex index.jsp index.html
&lt;/VirtualHost&gt;


&lt;VirtualHost x.x.x.x:80&gt;
    DocumentRoot /doc_root_for_other_files_on_port_80/
    ServerName otherserver2.server.com
    DirectoryIndex index.jsp index.html
&lt;/VirtualHost&gt;

#ssl config
SSLMutex sem
SSLRandomSeed startup builtin
SSLSessionCache none

ErrorLog logs/ssl.log

</code>

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.