Apache novice here,

We run a server with a few dozen vhosted sites, under apache 2.2.22 on ubuntu 12.0.4. None of them had a SSL before. We had a client request one the other day, and shortly after began my issue.

I thought I was doing well setting up that client's vhost with ssl. It is rewriting any http request on that domain to port 443 and serving the page on a secure layer. But I realized that any vhost request made with https://, is forwarding to the domain that ssl was set up on. All normal http requests are sent properly.

To sum it up...
We have:

 1. www.example1.com
 2. www.example2.com
 3. www.example3.com

I just set up SSL for www.example3.com, but any https:// request made to example1.com or example2.com, forward to https://www.example3.com.

Is there something I need to add to my httpd.conf file to turn off ssl globally, and within the vhost turn it on for the specific domain?

Any suggestions will help at this point.

  • Please update your question to include things like enabled-sites, htaccess etc. I suspect your using <VirtualHost *:443> which would indicate all, and you should try listening only on <VirtualHost domainname.com:443> – Simon Hayter May 31 '13 at 21:46

Your server is sending all the requests to the first vhost as it would if you accessed it using your server's IP address. HTTPS does not use named hosts like HTTP does. SSL requires each host to have its own unique IP address. You can then set up separate hosts based on the IP Addresses.

You have two options.

If this will be the only secure site on the server, just make sure it's defined first. This might mean moving the site settings to the top of a file or it might mean doing something so it gets read by Apache first.

If you will have more than one secure site, you must get additional IP addresses, one for each site, and configure Apache to respond to those rather than domain names.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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