Sunday 29 March 2015

Dispatcher Setup on Apache2/Ubuntu14.04 in AEM6 / CQ5

Hi, 

In this blog i would like to demonstrate how to set up Dispatcher Module in Apache2 and Ubuntu14.04. We use the dispatcher for Load Balancing and to Maintain the Cache. I will strict this blog only for How to install Dispatcher module and enable the cache. There are lots of settings as per the use-case we may need to apply on the dispatcher. This blog will help you to create a road map for those.

Use-Case : Set up dispatcher in Ubuntu14.04 and Enable the Cache.

Step 1 : Download the dispatcher from Package Share as per OS you are using. In my case it is :


Step 2 : Ubuntu14.04 has the apache already installed. You can check via hitting http://localhost/. You will get the welcome screen of apache. If it doesn't show, try to troubleshoot or re-install it. By Default Apache install under /etc directory with name of apache2.

Step 3 : Extract the dispatcher module downloaded in Step 1. You will get one folder with the name of conf and one file with .so extension which is the dispatcher module. Set the full permission on them.

Step 4 : Move you dispatcher-apache2.4-4.1.9.so file to /usr/lib/apache2/modules location. Create folder conf under /etc/apache2 and move the file dispatcher.any to /etc/apache2/conf folder.

Step 5 : Now configure your apache2.conf file under /etc/apache2 directory.

a) At line 69 you will find #ServerRoot "/etc/apache2" change it to  

 ServerRoot "/etc/apache2"
 ServerName localhost:80 


b) At the end after line # vim: syntax=apache ts=4 sw=4 sts=4 sr noet add the below snippet :

##### Dispatcher Configuration ######

LoadModule dispatcher_module /usr/lib/apache2/modules/dispatcher-apache2.4-4.1.9.so

<IfModule disp_apache2.c>
    # location of the configuration file. eg: 'conf/dispatcher.any'
    DispatcherConfig conf/dispatcher.any
    # location of the dispatcher log file. eg: 'logs/dispatcher.log'
    DispatcherLog /var/log/apache2/dispatcher.log
    DispatcherLogLevel 3
    DispatcherNoServerHeader 0
    DispatcherDeclineRoot 0
    DispatcherUseProcessedURL 1
    #DispatcherPassError 0
    DispatcherPassError 1   
    SetHandler dispatcher-handler
</IfModule>
SetOutputFilter INCLUDES


c) Restart the apache service using sudo service apache2 restart command. Apache2 server will restart without warning/error means configuration is [OK].

Step 6 : Now configure the dispatcher.any file that you placed under conf folder as in step 4.

a) Change the configuration of rend01 as below :
 /rend01
        {
        # Hostname or IP of the render
        /hostname "localhost"
        # Port of the render
        /port "4503"
        # Connect timeout in milliseconds, 0 to wait indefinitely
        # /timeout "0"
        }


b) Change the stafilelevel, look for  #/statfileslevel "0" and change it to 

          /statfileslevel "1"


Statfile Level tells, dispatcher will invalidate the cache from which level of cached pages. You can look over the adobe docs for more information.

c) Last thing to make sure that you have directory /opt/communique/dispatcher/cache with full permissions. This is the location where cache file will be maintain. You can change it via /docroot "/opt/communique/dispatcher/cache"  element in dispatcher.any.

Step 7 : Start your Publish instance via port 4503. And configure the dispatcher flush agent.

Step 8 : Hit  the URL http://localhost/content/geometrixx-outdoors/en.html. If you are able to see the geometrixx page . It means your publish successfully connected with dispatcher.

Step 9 : Check the directory /opt/communique/dispatcher/cache , it must contains two folder /content and /etc. If these are not there check out the permission for this folder & give full permission.

Two more things to add :
sudo a2enmod include (to enable SSI)
Uncomment  /allowAuthorized "1" from dispatcher.any file

Step 10 : Enjoy Caching :)

Thanks !!!!


No comments:

Post a Comment