Tuesday, 28 March 2023

Dispatcher configuration in AEM

Setting up Dispatcher on Windows 

1.       Download Apache2 32bit from - https://www.apachelounge.com/download/win32/

2.       Download Dispatcher Module from - https://drive.google.com/drive/u/2/folders/1Q6Dw0mPiUK2KKvGrcJXKeIheOBFajPZV

Note : In case if you are running windows 64bit machine, you might get an error while running httpd service as

 

Hence, you need to install the MS VC++ on your machine to get this issue resolved. Please follow the link below

https://learn.microsoft.com/en-us/answers/questions/234239/despite-everything-msvcr100-dll-still-missing

download the component from here - https://www.microsoft.com/en-us/download/details.aspx?id=26999

 

Installing the Apache HTTP webserver and starting it.

1.       Extract the folder into C Drive

c:/Apache2

2.       There are 2 ways how you can start the web server on your local

a.       by executing the httpd.exe from /bin folder

                                                                           i.      run command line using “Run as Administrator”

                                                                         ii.      go to the folder /Apache2/bin

                                                                       iii.      hit httpd command

                                                                       iv.      navigate to browser, and hit http://localhost, to check whether you see any success message like “It Works!”

b.       by installing the Apache2 as a windows service using below steps

                                                                           i.       run command line using “Run as Administrator”

                                                                         ii.      go to the folder /Apache2/bin

                                                                       iii.      run httpd -k install

this will install the Apache2 as a Windows service.

                                                                       iv.      Open run prompt using windowsKey+R, and type services.msc

                                                                         v.      find the service named Apache2

                                                                       vi.      If not already started, start it.

                                                                      vii.      navigate to browser, and hit http://localhost, to check whether you see any success message like “It Works!”

Configuring dispatcher module with Apache HTTP server

1.       extract the zip containing dispatcher module files/configurations.

2.       copy the file disp_apache2.2.dll to C:\Apache2\modules

3.       copy the file dispatcher.any to C:\Apache2\conf

4.       Open the file C:\Apache2\conf\httpd.conf and load the dispatcher module in the loadmodules section using below line

LoadModule dispatcher_module  modules/disp_apache2.2.dll

5.       Configure the handler and integrate the dispatcher module.

<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    logs/dispatcher.log

   

    # log level for the dispatcher log, can be either specified

    # as a string or an integer (in parentheses)

    # error(0): Errors

    # warn(1):  Warnings

    # info(2):  Infos

    # debug(3): Debug

    # trace(4): Trace

    DispatcherLogLevel warn

   

    # if turned on, the dispatcher looks like a normal module

    DispatcherNoServerHeader 3

   

    # if turned on, request to / are not handled by the dispatcher

    # use the mod_alias then for the correct mapping

    DispatcherDeclineRoot 0

   

    # if turned on, the dispatcher uses the URL already processed

    # by handlers preceeding the dispatcher (i.e. mod_rewrite)

    # instead of the original one passed to the web server.

    DispatcherUseProcessedURL 1

   

    # if turned to 1, the dispatcher does not spool an error

    # response to the client (where the status code is greater

    # or equal than 400), but passes the status code to

    # Apache, which e.g. allows an ErrorDocument directive

    # to process such a status code.

    #

    # Additionally, one can specify the status code ranges that should

    # be left to web server to handle, e.g.

    #

    # DispatcherPassError 400-404,501

    DispatcherPassError 0

 

    #

    # DispatcherKeepAliveTimeout specifies the number of seconds a

    # connection to a backend should be kept alive. If not set or

    # set to zero, connections are not kept alive.

    #

    #DispatcherKeepAliveTimeout 60

 

</IfModule>

 

<Directory />

    <IfModule disp_apache2.c>

        ModMimeUsePathInfo On

        # enable dispatcher for ALL request. if this is too restrictive,

        # move it to another location

        SetHandler dispatcher-handler

    </IfModule>

 

    Options FollowSymLinks

    AllowOverride None

</Directory>

6.       Next step is to configure the file C:\Apache2\conf\dispatcher.any with the rules

To bring it to working state, pls update the /renders section with appropriate port number on which your publish instance is running.

e.g.

/renders

      {

      /rend01

        {

        # Hostname or IP of the render

        /hostname "127.0.0.1"

        # Port of the render

        /port "4503"

        # Connect timeout in milliseconds, 0 to wait indefinitely

        # /timeout "0"

        }

      }

     

 

 

 


No comments:

Post a Comment

Dispatcher configurations in AEM - 2

 Dispatcher configuration 1. The Dispatcher configuration is stored in the dispatcher.any text file. 2. The file contains a series of single...