✨ Quote of the Day ✨
“Every day brings a new opportunity!” π±
Why Do We Need Dispatcher in AEM?
- When a website receives millions of requests, if every request directly hits AEM, it would become slow and overloaded. AEM is powerful for creating, managing, and publishing content, but handling things like caching, redirects, load balancing, and security is not its main job.
- That’s why we never expose AEM publish servers directly to end users. Instead, we place a web server in between. But a normal web server alone doesn’t know how to work with AEM.
- To solve this, Adobe provides the Dispatcher – a module that works with the web server.
π Dispatcher helps with:
⚡ Caching → Serves pages instantly without hitting AEM every time
-
π Load Balancing → Distributes traffic across multiple AEM instances
-
π Security → Blocks unwanted requests and protects AEM servers
-
π― Request Handling → Manages redirects and access control
photo:
What is Dispatcher?
π Dispatcher in AEM is a caching and load balancing tool that sits in front of the publish instance. It improves performance by serving cached content, ensures scalability by distributing requests, and adds security by filtering access to AEM.
π How to Set Up AEM Dispatcher
πΉ Step 1: Understand the Architecture
π User request → Web Server + Dispatcher → AEM Publish Instance
Here, Dispatcher is not a standalone server – it’s a module installed on a web server like Apache HTTP Server or Microsoft IIS.
πΉ Step 2: Install a Web Server
1. Choose your web server (commonly Apache HTTPD).
Open URL and download below highlighted .msi file highlighted red in color to setup Apache Web Server.
3. Select option I accept the terms in the license agreement and click on Next button.
4. Click on Next button as no changes are required.
5. Click on Next button as no changes are required.
6. Select Typical and click on Next button.
7. Select folder to install Apache server if want to install in required folder or else leave it as it is.
12. Open URL and download required file. For current setup we are going to have OpenSSL as none as highlighted below red in color.
13. Unzip downloaded folder and verify below files:
14. Navigate to Apache download folder and looks for httpd.conf file
17. And add Configuration inside <IfModule> 133 to 147 and add directory 149 to 159, and add 154 SetHandler dispatcher-handler.
π Line-by-Line Explanation
-
<Directory /> ... </Directory>-
This applies rules to the root directory
/(i.e., the entire server). -
Means: these settings affect all incoming requests.
-
-
<IfModule disp_apache2.c>-
Only applies if the Dispatcher module (
disp_apache2.c) is loaded. -
Dispatcher is Adobe’s caching & load balancing module for AEM.
-
-
ModMimeUsePathInfo On-
Tells Apache to use extra path info after a file.
-
Example:
/page.html/extra/path→ the/extra/pathpart is still recognized and passed along. -
Useful in AEM, where selectors like
/page.print.htmlor/page.html/some/dataare common.
-
-
SetHandler dispatcher-handler-
Basically, every request will go through the Dispatcher first (for caching & filtering).
-
-
Options FollowSymLinks-
Allows Apache to follow symbolic links (shortcuts to files/folders).
-
Needed so Apache can resolve linked paths properly.
-
-
AllowOverride None -
Prevents
.htaccessfiles from overriding these settings. -
Means: only this config file controls behavior, no local overrides.
-
Improves security and performance.
docroot path inside the cache section of your dispatcher.any farm file to point to your web server’s document root.21. Update port number from 8080 to your AEM publish post, in my case it is 4503.
Restart Web server (apache).
AEM Publish instance URL
http://localhost:4503/content/we-retail/us/en/men.html
Both AEM publish and dispatcher URL’s will show the same page. One will be via dispatcher and other by hitting direct AEM publish instance URL using 4503 port.
Thank you!
No comments:
Post a Comment