logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Dynamic VirtualHost ?
Author
fryser_d



Joined: 11 Aug 2017
Posts: 5
Location: Canada

PostPosted: Sat 12 Aug '17 3:06    Post subject: Dynamic VirtualHost ? Reply with quote

Ok... We are a cloud website provider... we want to route our tenants to their new generated website !!BY DOMAIN!! with SSL certificate and SNI.

1- We want to use *.editor.xxxxxx.com and *.xxxxxx.com to route to xxxxxx.com with our wildcard SSL Certificate.
2- We want EVERY OTHER REQUEST to get their certificate FROM THE FILESYSTEM ORGANISED BY FOLDERS

EX:
exemple.com => get its certificate from \repository\exemple.com\certificate.crt
test.com => get its certificate from \repository\test.com\certificate.crt
fake.com => get its certificate from \repository\fake.com\certificate.crt

THE CONFIGURATION BELOW WORKS!
Code:

                <VirtualHost *:443>
                        ServerName wildcard.editor.xxxxxx.com
                        ServerAlias *.editor.xxxxxx.com

                        DocumentRoot /var/www/html

                        SSLEngine on
                        SSLCertificateFile "/var/app/s3/ssl/editor.xxxxxx.com/certificate.crt"
                        SSLCertificateKeyFile "/var/app/s3/ssl/editor.xxxxxx.com/certificate.key"
                        SSLCertificateChainFile "/var/app/s3/ssl/editor.xxxxxx.com/certificate.chain"
                        SSLCipherSuite        EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
                        SSLProtocol           All -SSLv2 -SSLv3
                        SSLHonorCipherOrder   On
                        SSLSessionTickets     Off
                </VirtualHost>

                <VirtualHost *:443>
                        ServerName wildcard.xxxxxx.com
                        ServerAlias *.xxxxxx.com

                        DocumentRoot /var/www/html

                        SSLEngine on
                        SSLCertificateFile "/var/app/s3/ssl/xxxxxx.com/certificate.crt"
                        SSLCertificateKeyFile "/var/app/s3/ssl/xxxxxx.com/certificate.key"
                        SSLCertificateChainFile "/var/app/s3/ssl/xxxxxx.com/certificate.chain"
                        SSLCipherSuite        EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
                        SSLProtocol           All -SSLv2 -SSLv3
                        SSLHonorCipherOrder   On
                        SSLSessionTickets     Off
                </VirtualHost>

                <VirtualHost *:443>
                        ServerName tenant1.ca
                        ServerAlias www.tenant1.ca

                        DocumentRoot /var/www/html

                        SSLEngine on
                        SSLCertificateFile "/var/app/s3/ssl/tenant1.ca/certificate.crt"
                        SSLCertificateKeyFile "/var/app/s3/ssl/tenant1.ca/certificate.key"
                        SSLCertificateChainFile "/var/app/s3/ssl/tenant1.ca/certificate.chain"
                        SSLCipherSuite        EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
                        SSLProtocol           All -SSLv2 -SSLv3
                        SSLHonorCipherOrder   On
                        SSLSessionTickets     Off
                </VirtualHost>


This configuration is STATIC
We would want this DYNAMIC!!! Meaning We dont want to add a new VirtualHost to resolve the request for each tenant. We want to use one virtualhost but with variables


ex:
SSLCertificateFile "/var/app/s3/ssl/%host/certificate.crt"
SSLCertificateKeyFile "/var/app/s3/ssl/%host/certificate.key"
SSLCertificateChainFile "/var/app/s3/ssl/%host/certificate.chain"

Can we have some help please? Mr. Green
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Sat 12 Aug '17 13:42    Post subject: Reply with quote

AFAIK there are three options
use mod_vhost_alias [1]
use mod_rewrite [2]
use mod_macro [3]

if you still have a question please ask again.



[1] https://httpd.apache.org/docs/2.4/vhosts/mass.html
[2] https://httpd.apache.org/docs/2.4/rewrite/vhosts.html
[3] https://httpd.apache.org/docs/2.4/mod/mod_macro.html
Back to top


Reply to topic   Topic: Dynamic VirtualHost ? View previous topic :: View next topic
Post new topic   Forum Index -> Apache