Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have SSL set up on an Ubuntu server. This server is running Apache 2 with multiple Virtual Hosts. I've read that you need a single IP for each application running SSL.

My questions are:

  1. If only one website on the server is using SSL will this still work? One IP for one SSL website, even though the other websites are still running on it (They wouldn't have SSL enabled).
  2. If so, how can I make the default SSL website point to the content of the website I would like to have SSL?
share|improve this question
How are your <VirtualHost> sections configured? – Shane Madden Nov 8 '11 at 20:53
I don't exactly know which ones you want? There's a <VirtualHost> in each file in the sites-available folder. All have "ServerAdmin" "ServerName" "ServerAlias" and "DocumentRoot". They're pretty short. the default file is a bit longer and default-ssl is really long, that's the file I changed to point to the certificate. Can you give me some guidance on the file and section to post? – user29600 Nov 8 '11 at 23:31

Sounds like you need to modify the _default_ vhost for SSL.

Essentially it is true that you can only run one SSL site per IP or port. However this ONLamp article shows how you can do it anyway. If you use name-based virtual hosts on SSL you will get certificate warnings from any domain name that doesn't match what is in the certificate. If you're OK with this, then you can just do it, but your users may not like getting security warnings when they access the site so bear that in mind.

share|improve this answer
I agree, security warnings aren't going to fly. By modifying the _default_ vhost for SSL (/etc/apache2/sites-available/default-ssl I'm guessing?) that will still allow me to apply SSL to one of the sites on this server without giving users an error? If so, what do I need to modify in this file? – user29600 Nov 8 '11 at 23:33
@user29600 Essentially, you need to make it match to what's in the site you want to serve with it; start by changing the DocumentRoot to that of the site you want to serve over SSL, and go from there; bring in anything necessary from the <VirtualHost> of the non-SSL version of the site (handlers for dynamic content, rewrite rules, etc). Oh, and make sure you've done a2enmod ssl and a2ensite default-ssl. – Shane Madden Nov 8 '11 at 23:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.