コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

AEMaaCS Dispatcher for multi site

Avatar

Level 2

In AEMaaCS , for a multi site setup

 

In conf.d

1. can we have a common vhost code in a seperate file and then reference it in siteA.vhost and siteB.vhost ?

2. How about having common rewrites and site specific rewrites . in which folder we should put them and how to include them in vhost ?

 

In conf.dispatcher.d

1. can we maintain site specific farms ? and how to manage it using virtualhosts.any file ?

2. how to include site specific filters , like filtersA.any inside filter.any 

3. how to include site specific cache rules , like including siteACache.any  in site specific farm file 

トピック

トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。

2 返信

Avatar

Community Advisor

Hi @VishnuRa5,

Here’s how you can structure a multi-site Dispatcher setup in AEM as a Cloud Service (AEMaaCS).
I’ll break it down by conf.d (Apache HTTPD layer) and conf.dispatcher.d (Dispatcher configs).

In conf.d (Apache vhost layer)

  1. Common vhost code

    • Yes, you can absolutely put shared logic (like SSL, headers, logging, or other boilerplate config) into a separate include file.

    • Example:

      # conf.d/includes/common_vhost.conf
      <IfModule mod_headers.c>
        Header always set X-Frame-Options "SAMEORIGIN"
      </IfModule>
      Then in each site vhost:
      
      
      Include conf.d/includes/common_vhost.conf
  2. Common vs. site-specific rewrites

    • Put global rewrites under something like conf.d/rewrites/global_rewrite.rules.

    • Put site-specific rewrites under conf.d/rewrites/siteA_rewrite.rules, siteB_rewrite.rules.

    • Reference them in each vhost file:

      # Inside siteA.vhost
      Include conf.d/rewrites/global_rewrite.rules
      Include conf.d/rewrites/siteA_rewrite.rules

In conf.dispatcher.d (Dispatcher layer)

  1. Site-specific farms

    • Yes, you can maintain separate farm files per site, e.g.:

      • conf.dispatcher.d/available_farms/siteA_farm.anyconf.dispatcher.d/available_farms/siteB_farm.any

    • Then symlink them into enabled_farms/.

    • Use the virtualhosts section in each farm to match requests for that site:

      /virtualhosts {
        "/sitea.domain.com/*"
        "/sitea/*"
      }
  2. Site-specific filters

    • Create files like filtersA.any, filtersB.any.

    • In your main filter.any you can include them:

      $include "filtersA.any"
      $include "filtersB.any"
  3. Site-specific cache rules

    • Same approach. Create siteACache.any, siteBCache.any.

    • In each farm file, reference its own cache rules:

      /cache {
        /rules {
          $include "../cache/siteACache.any"
        }
      }

Recommended Folder Structure

conf.d/
 ├─ available_vhosts/
 │   ├─ siteA.vhost
 │   ├─ siteB.vhost
 │   └─ common_vhost.conf
 ├─ rewrites/
 │   ├─ global_rewrite.rules
 │   ├─ siteA_rewrite.rules
 │   └─ siteB_rewrite.rules

conf.dispatcher.d/
 ├─ available_farms/
 │   ├─ siteA_farm.any
 │   ├─ siteB_farm.any
 ├─ filters/
 │   ├─ filter.any   (includes all site filters)
 │   ├─ filtersA.any
 │   └─ filtersB.any
 ├─ cache/
 │   ├─ siteACache.any
 │   └─ siteBCache.any

This way you keep common logic reusable, and still have clean separation for site-specific overrides.


Santosh Sai

AEM BlogsLinkedIn


Avatar

Level 2

@SantoshSai  

thankyou verymuch , it worked.

 

Similar to having a coomon vhost configuration file , 

can we keep common code in farm files in a seperate file and reference it in siteA_farm.any and siteB_farm.any ?