I have two different domains - thisdomain.com and otherdomain.com, we can't do anything with wildcards here.

  • The domains have their own SSL certificates.
  • The domains both have their own separate IP addresses.

My customer ideally wants to use both these domains on the same site on Apache. With non-SSL access this is no problem because I just add the requisite host headers.

I am aware of SAN certificates as described in this answer, but the customer wants to keep both domains on different IP addresses.

I know I can have two different virtual hosts pointing to the same content, but can it be done using just one virtual host?

I can do this on IIS7, but just wondered if Apache can do this as well.

  • 2
    Just playing devil's advocate here... why can't you use two virtual hosts?
    – iainlbc
    Aug 19, 2011 at 18:17
  • And well played. But as I said, customer requirement was to have a single host. I also wanted to know the extent of Apache's capabilities in this respect so it can be documented for end users.
    – Kev
    Aug 19, 2011 at 20:20

2 Answers 2


No; a given VirtualHost block can only have a single SSL certificate configured. Architecturally, an SSL certificate in Apache is assigned to the VirtualHost, which then attaches to the ports, instead of the IIS way of attaching an SSL cert to a specific binding.

While you could attach the VirtualHost to both addresses easily, there's no way to present a different SSL cert on the separate IPs without doing separate vhosts.


Actually, you can do this with UCC certs quite easily (one cert that covers multiple domains). But in practice, if you've already got the certs and IPs, just use two vhosts.

  • He mentioned that the client was uninterested in using a SAN certificate in the question, because of the desire to keep the sites on separate addresses. But, there's no reason that you couldn't still use 2 addresses with a SAN cert, so that's a moot point.. If there's a need to keep everything in a single vhost for some reason, I like this approach; +1. Aug 19, 2011 at 19:14
  • Indeed I do know all about SAN certs, but I just didn't know if Apache was capable of supporting more than one SSL per virtual host and wanted a definitive answer.
    – Kev
    Aug 19, 2011 at 20:24

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.