[CentOS] SSL and virtual hosts?

Niki Kovacs

contact at kikinovak.net
Sun Sep 20 09:36:44 UTC 2009


Hi,

I successfully managed to use SSL on a local webserver for testing 
purposes, following the section "Using SSL" in the Chapter "Using 
Apache" of the "Definitive Guide to CentOS". Now I wonder: how can I use 
SSL with virtual hosts?

I have several virtual hosts defined. Let's say I want to use SSL with 
this one:

<VirtualHost *:80>
   ServerAdmin info at microlinux.fr
   DocumentRoot /var/www/html/microlinux
   ServerName buildbox.presbytere.local
   ServerAlias microlinux.buildbox.presbytere.local
   ServerAlias microlinux.buildbox
   ErrorLog logs/microlinux-error_log
   CustomLog logs/microlinux-access_log common
</VirtualHost>

The key and certificate files are located in /etc/certs:

# ls -lh /etc/certs
total 12K
-rw-r--r-- 1 root root 981 sep 20 11:06 microlinux.crt
-rw-r--r-- 1 root root 716 sep 20 11:04 microlinux.csr
-rw-r--r-- 1 root root 887 sep 20 11:11 microlinux.key

I'm not sure about the correct syntax to use SSL on this one. Where do I 
configure SSLCertificateFile and SSLCertificateKeyFile? In the virtual 
host stanza? Before trying various haphazard configurations, I thought 
I'd better ask here.

Niki



More information about the CentOS mailing list