Multiple SSL certificates per domain on same vhost

#1
Hello,

I have one virtual host listen on secured 443 port with three domain mappings:

  1. example1.com
  2. example2.com
  3. example3.com
How do i add my certificates for each domain? I can only specify one certificate at virtual host level.
The only way i can do this looks like is if i add 3 separated virtual hosts with same config but different domain name and certificate. In that case, (i didn't tested) since i`m using process-group LSAPIit will spawn 3 separated PHP processes with same user, so cached objects in php process cant be shared, required 3 times more memory for cache.

Any solution?
 
#2
The only way i can make this works is the following:

1. 3 separated virtual hosts, each with single domain listener mapping and dedicated certificate pairs
2. All 3 virtual hosts runs inside cloudlinux cagefs, ExtApp Set UID Mode is "DocRoot UID" so the php process will be started with same user. http://prntscr.com/cyh05r
3. All 3 virtual hosts have exactly the same LSAPI config, autostart is "ON" and Run On Start Up is "NO"

In this scenario, looks like only one main PHP process is running and all 3 virtual hosts share the same process.

http://prnt.sc/cygxrs

Also i was testing with simple logic php code:

<?php

$domain = $_SERVER['SERVER_NAME'];
echo 'This is ' .$domain .' <br>';

if($domain == 'example1.com'){
apcu_add('foo', 'cached');
echo 'cached';
}else{
var_dump(apcu_fetch('foo'));
}


Accessing example1.com/test.php to store the cache then i was able to retrieve on example2.com/test.php and example3.com/test.php.

Can anyone from Litespeed confirm this or give other solution?
 
Last edited:
Top