Apache multiple virtual hosts with ssl certificates

1,034

Solution 1

Each IP address/port can only serve one SSL certificate. In order to get more than one SSL to work, you'll either need another IP address (recommended) or bind the second SSL certificate to another port on your IP (functional, but a pain for your site visitors b/c the port has to be included in the URL). Check with your host, most of them make additional IP's available affordably.

This thread has more info.

Edit: I can't grammar.

Solution 2

The configuration you posted should be correct, but you must use <VirtualHost *:443> in both cases, and not <VirtualHost domain1.cz:443> or <VirtualHost domain2.sk:443>.

You are correct in specifying domain1.cz and domain2.sk in the ServerName directive.

Please note that this will use a feature called Server Name Indication. You must be running a sufficiently recent copy of Apache and the OpenSSL libraries, and it won't work with older browsers. Read more here about SNI.

Share:
1,034

Related videos on Youtube

Daksh Shah
Author by

Daksh Shah

Updated on September 18, 2022

Comments

  • Daksh Shah
    Daksh Shah over 1 year

    I use Sublime Text 3 as my primary text editor with the Material Theme. All my code looks generally like this:

    Material theme working fine

    The color scheme for all markdown files was also something similar to this. However, a few hours back all .md files got a weird color scheme and they look like this now:Markdown files color scheme messed up

    I haven't installed any new package or plugin. This happened all of a sudden. What could be the problem?

    • OdatNurd
      OdatNurd almost 7 years
      Color scheme is a setting that can be applied on a syntax-specific basis, so that's a potential cause. You can do Sublime Text > Preferences > Settings - Syntax Specific while you have a markdown file open to see if there's something like that in there. You can also open the Sublime console (View > Show Console) and enter view.settings().get("color_scheme") to see if the color scheme is the one you think it is.
    • Praveen Kumar Purushothaman
      Praveen Kumar Purushothaman almost 7 years
      Uh, your images aren't displaying... Oh sorry, imgur is down.
  • vallismortis
    vallismortis almost 9 years
    This was true at one point, but some improvements in OpenSSL and modssl provide a way to serve different certificates for different virtual hosts for clients that support Server Name Indication.