Named VirtualHosts for SSL Websites in CentOS 5.7 (Final)

In my development work, I often have to imitate live servers on my development machine. Up to this point, I’ve only ever had to have one site using a secure certificate. Today I had to setup a second site, and thought I would post what I did.

First, I added the line to /etc/httpd/conf.d/ssl.conf above the first VirtualHost directive:

NameVirtualHost 123.123.123.123:443

I then changed the existing VirtualHost definition from:

<VirtualHost _default_:443>

to:

<VirtualHost 123.123.123.123:443>

Once that was completed, I then copied the entire VirtualHost container, specifying the new domain, web root, etc. Once saved, I restarted Apache:

sudo /etc/init.d/httpd restart

Voila! I have two sites I can call via my locally signed certificate on 1 machine.

Comments

comments

Posted in Linux Tagged with: , ,