Thursday, January 12, 2023

Setup AEM Dispatcher on Apache on Windows

 Setup AEM Dispatcher on Apache on Windows





 

Dispatcher
  • It is a caching or load balancing tool. The dispatcher is part of apache web server
  • You can understand dispatcher is a layer between server and aem when any user request first time to the server then dispatcher create cache for that request.

Method for Caching

Content Update
  • It removes all changed files and all files that are related to this change file, from the cache.
  • It touches the statfile, and updates the timestamp of the state file to find out the date of the last modification.  
  • files that are modified will be removed from the cache but will not be replaced with new files immediately. next time when this file will be requested by the user then it will fetch this from the AEM instance and will serve to the user and also will keep a copy as a cache.
  • Here each folder may contain its own statfile.
Auto-Invalidation
  • It does not remove the file physically. It only invalidates the part of the cache. at every modification it touches the statfile. so timestamps of statfile reflect the last content update.
  • Dispatcher has all files that are subjected to auto-invalidate. if the user request for any file then the dispatcher compares the date of the cached file with statfile. 
  • if files are not old then the dispatcher returns the requested file.
  • if files are old then it retrieves a new version of a file from an instance and then the server to users and also keeps a copy
  • Auto invalidate does not perform any action by the dispatcher on update time, it just touches the statfile to update timestamps.

 How Dispatcher Perform Load Balancing

 Load balancing is the way of distributing the user's request access to the multiple adobe aem instances

Performance Statistics
Dispatcher keeps the information of each AEM instance about how much it is fast to process the files.
on the basis of this information, the Dispatcher estimate which instance can provide a fast response to this request

Personalized Content:
sticky connections ensure that all files for a user belong to the same adobe aem instance.


How to configure dispatcher in AEM

You should always be configuring the dispatcher at the publisher level - dispatcher in front of publisher instances is the standard approach - almost all the dispatcher documentation is geared towards how to configure the dispatcher for a publisher instance. Adobe discontinued dispatcher module  for apache 2.4 64bit on windows So we will use following versions

  • Apache 2.2 32bit (apache 2.2windows-x84)
  • Dispatcher 4.2.1(dispatcher-apache 2.2)

Installation Process

  • Install apache 2.2 in your system at any location 

  • Extract dispatcher at any location
  • After installing apache test it's working or not by default apache work on port 80. if in your laptop port, 80 is used by another program then change the port (for changing port you can go in your installed apache->conf->httpd file  and  write your new port in front of listen and serverName


)

  • If you hit localhost:your_port and it shows the bottom message it means your apache is working.

  • Then, go to apache->conf->httpd file and past the bottom script like me



LoadModule dispatcher_module modules/disp_apache2.2.dll
<IfModule disp_apache2.c>
    DispatcherConfig conf/dispatcher.any
    DispatcherLog logs/dispatcher.log

    DispatcherLogLevel 3
    DispatcherdeclineRoot 0
    DispatcherUseProcessedURL 1
</IfModule>

<Directory />
    <IfModule disp_apache2.c>
        ModMimeUsePathInfo On
        SetHandler dispatcher-handler
    </IfModule>
    Options FollowSymLinks
    AllowOverride None
</Directory>
 

  •  You need to move "disp_apache2.2.dll" file from the dispatcher to the apache->modules folder
  •  Move "dispatcher.any" file from the dispatcher to apache->conf folder
  • Goto apache->conf->dispatcher.any file and in renders write publisher port

  • Go to apache->conf->dispatcher.any file and set the path where dispatcher will create the cache 



  • Restart your apache server and hit the URL your project will work


    and there will be a cache in the location that u mention in your dispatcher.any file

  • If your clintlibs not load properly goto->apache->conf->dispatcher.any and in filter part instead of deny write allow



  • And restart your apache server again and hit URL it will work fine 


Thanks  

Previous Post
Next Post

post written by:

0 comments: