One apache installation can easily host multiple domains using a couple different VirtualHost directives. Basically, a standard HTTP request includes the requested domain name, and Apache uses that to determine which pages to serve up.

From what I understand, SSL-encrypted sites are a wee bit trickier, because HTTPS requests are encrypted and the requested domain name isn’t available. So all you have to go by is the IP address…. and the port. So that’s the trick – you have to use a different port for each SSL-encrypted domain name you want to support.

Steps to make Apache listen for SSL requests for different domains on 443 and 8080:

  • Add “Listen 443” and “Listen 8080” directives at the top of your apache configuration.
  • Add a “VirtualHost myfirstsite.com:443” block for the first site, and a “VirtualHost mysecondsite.com:8080” for the second.
  • Make sure your firewall allows incoming traffic on both ports.

    See? Easy. :> And since your website will typically redirect traffic to SSL pages (as opposed to expecting users to type them in), hopefully using a non-default port won’t be a problem.

  • Leave a Reply