How to configure SSL for my VirtualHosts on Apache 2

Can someone plz help with some examples of an httpd.conf file of how to configure SSl support for a) entire VirtualHost folder, and b) only certain sub-folder of a VirualHost. I also need help to create the certificates etc (self signed).

LVL 17
Who is Participating?
blklineConnect With a Mentor Commented:
You can not configure SSL support for virtual hosts unless each virtual host has its own IP.  
The reason?  Because the handshaking for SSL happens before Apache ever finds out which host is being requested, so you'd not be able to associate a certificate with a given host.
psimationAuthor Commented:
Would it then be possible to use only one domain, the FQDN of the server? IE, if one of my virtualhosts needs secure folder, I just point it to a subfolder of the "top" domain?  
Yes.   You can have virtual hosts and SSL on the same box, just ensure that your default host is the one configured for SSL and use that.
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

psimationAuthor Commented:
Well, that's sort of why I asked the question... Can you give me examples of how to configure it?
A complete guide to configuring Apache and SSL can be found at:

Look in the upper right-hand corner of the screen and you'll see the guide available.  Don't be put off by the fact that it mentions Thawte, the configuration is the same for whichever  certificate you choose.

The file you'll need to configure is:   /etc/httpd/conf.d/ssl.conf

The default virtual host is the first one in your httpd.conf file.

If you have specific questions after checking that guide then be sure to post away!
TheDefiantConnect With a Mentor Commented:
> You can not configure SSL support for virtual hosts unless each virtual host has its own IP.
This statement is incorrect.  I use Apache (for WinNT) and I am using SSL on more than one NameVirtualHost.  It works perfectly fine.  I even have a standard HTTP in addition to the SSL-enabled HTTPS, with a couple of HTTP redirecting to the HTTPS of the same name.

If I had access to my server system right now, to post some .conf snippets, I would.  Unfortunately, I'm at work, on my break, and my server is currently offline ATM. :-P

But, it is absolutely possible to do...  Read the documentation at the links provided by everyone else, and you should be fine.
All Courses

From novice to tech pro — start learning today.