Virtual host config | Community
Skip to main content
lavishvasuja
Level 3
March 12, 2023
Solved

Virtual host config

  • March 12, 2023
  • 2 replies
  • 882 views

Hi There,

 

We are trying to create virtualhost for our multiwebsite. We are following this link https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-domains.html?lang=en#aem-rewrites-incoming-urls We have created different virtualhost for both website. 

 

In vhost file what is DocumentRoot "${DOCROOT}" and value of this variable for different domain?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by AlbinIs1

The simplified approach is(this is followed as part of the latest AMS/AEMasaCloud Dispatcher configurations)

  • Use a common docroot e.g. "/mnt/var/www/html" for all the Vhosts and farm files
  • Enable PT rules in rewrite file to send the request to AEM Publisher with complete URL - this helps to cache multiple website content into a common docroot without impacting each other. e.g 
    RewriteCond %{REQUEST_URI} !^/apps/(.*) [NC] RewriteCond %{REQUEST_URI} !^/etc(.*) [NC] RewriteCond %{REQUEST_URI} !^/libs(.*) [NC] RewriteCond %{REQUEST_URI} !^/content(.*) [NC] RewriteCond %{REQUEST_URI} !^/system(.*) [NC] RewriteCond %{REQUEST_URI} !^/dam(.*) [NC] RewriteRule ^/(.*) /content/test/$1 [PT]

    Regards

    Albin

    https://www.albinsblog.com

2 replies

TarunKumar
Community Advisor
Community Advisor
March 13, 2023

HI @lavishvasuja ,

The /docroot property identifies the directory where cached files are stored.The value must be the exact same path as the document root of the web server so that Dispatcher and the web server handle the same files.The web server is responsible for delivering the correct status code when the dispatcher cache file is used, that’s why it is important that it can find it as well.

If you use multiple farms, each farm must use  a different document root.
Hope it helps!

Thanks
Tarun

AlbinIs1Community AdvisorAccepted solution
Community Advisor
March 13, 2023

The simplified approach is(this is followed as part of the latest AMS/AEMasaCloud Dispatcher configurations)

  • Use a common docroot e.g. "/mnt/var/www/html" for all the Vhosts and farm files
  • Enable PT rules in rewrite file to send the request to AEM Publisher with complete URL - this helps to cache multiple website content into a common docroot without impacting each other. e.g 
    RewriteCond %{REQUEST_URI} !^/apps/(.*) [NC] RewriteCond %{REQUEST_URI} !^/etc(.*) [NC] RewriteCond %{REQUEST_URI} !^/libs(.*) [NC] RewriteCond %{REQUEST_URI} !^/content(.*) [NC] RewriteCond %{REQUEST_URI} !^/system(.*) [NC] RewriteCond %{REQUEST_URI} !^/dam(.*) [NC] RewriteRule ^/(.*) /content/test/$1 [PT]

    Regards

    Albin

    https://www.albinsblog.com