Expand my Community achievements bar.

SOLVED

Virtual host config

Avatar

Level 2

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-d... We have created different virtualhost for both website. 

 

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

2 Replies

Avatar

Community Advisor

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

Avatar

Correct answer by
Community Advisor

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