CQ Dispatcher Apache Set Up

CQ Dispatcher

Set up Dispatcher on Apache

Install Apache:

  • Based on version of Apache instruction could be different
  • Please refer http://httpd.apache.org/docs/2.2/install.html to download and install
  • You can also use quick instruction for mac (Your own Apache) as follows

Install Apache on Mac

It is also part of xcode http://developer.apple.com/technologies/tools/

  1. Download latest apache built from http://httpd.apache.org/download.cgi#apache22
  2. install using direction given in http://httpd.apache.org/docs/2.2/install.html
  3. Make sure that for PREFIX you use current location
  • Follow steps

Download $ lynx http://httpd.apache.org/download.cgi

Extract $ gzip -d httpd-NN.tar.gz

$ tar xvf httpd-NN.tar

$ cd httpd-NN

Configure $ ./configure --prefix=PREFIX

Compile $ make

Install $ make install

Customize $ vi PREFIX/conf/httpd.conf

Test $ PREFIX/bin/apachectl -k start

Install Dispatcher on Apache:

  • Get dispatcher from Adobe. You can use Package Share to get dispatcher. More information can be obtained from here
  • File name follow format dispatcher-<web-server>-<operating-system>-<dispatcher-version-number>.<file-format>
  • Installation file contains following files depending upon version of apache (On windows or unix based)

Apache Dispatcher Zip Content

  • Use following steps to add dispatcher on apache web server

Dispatcher Specific Configuration

Place the Dispatcher file in the appropriate Apache module directory:

  • Windows: Place disp_apache<x.y>.dll <APACHE_ROOT>/modules
  • Unix: Locate either the <APACHE_ROOT>/libexec or <APACHE_ROOT>/modules directory according to your installation.
    • Copy dispatcher-apache<options>.so into this directory.
    • To simplify long-term maintenance you can also create a symbolic link named mod_dispatcher.so to the Dispatcher:
    • ln -s dispatcher-apache<x>-<os>-<rel-nr>.so mod_dispatcher.so

Copy the dispatcher.any file to the <APACHE_ROOT>/conf directory.

  1. Navigate to <APACHE_ROOT>/conf.
  2. Open httpd.conf for editing.
  3. The following configuration entries must be added, in the order listed:
    • LoadModule to load the module on start up.
    • AddModule to enable the module. (Apache 1.3 only).
    • Dispatcher-specific configuration entries, including DispatcherConfig, DispatcherLog and DispatcherLogLevel.
    • SetHandler to activate the Dispatcher. LoadModule.
    • ModMimeUsePathInfo to configure behavior of mod_mime.

The following configuration steps are optional, but recommended:

  1. Change the owner of the htdocs directory:
    • The apache server starts as root, though the child processes start as daemon (for security purposes). The DocumentRoot (<APACHE_ROOT>/htdocs) must belong to the user daemon:
      • cd <APACHE_ROOT>
      • chown -R daemon:daemon htdocs
        1. The following table lists examples that can be used; the exact entries are according to your specific Apache Web Server:
              1. Windows
              2. Unix
              3. (assuming symbolic link)
              1. ...
              2. LoadModule dispatcher_module modules\disp_apache.dll
              3. ...
              4. ...
              5. LoadModule dispatcher_module libexec/mod_dispatcher.so
              6. ...
  • These are Dispatcher specific configuration entries

Apache Dispatcher Specific Configuration

Windows

and

Unix

...

<IfModule disp_apache2.c>

DispatcherConfig conf/dispatcher.any

DispatcherLog logs/dispatcher.log

DispatcherLogLevel 3

DispatcherNoServerHeader 0

DispatcherDeclineRoot 0

DispatcherUseProcessedURL 0

DispatcherPassError 0

</IfModule>

...

The individual configuration parameters:

  • Then In order for apache to use dispatcher as request handler, You have to add SetHandler configuration

Dispatcher Set Handler Configuration

Windows

and

Unix

...

<Directory />

<IfModule disp_apache2.c>

SetHandler dispatcher-handler

</IfModule>

Options FollowSymLinks

AllowOverride None

</Directory>

...

The following example configures the Dispatcher to handle requests for a virtual domain:

Windows

Unix

...

<VirtualHost 123.45.67.89>

ServerName www.mycompany.com

DocumentRoot [cache-path]\docs

<Directory [cache-path]\docs>

<IfModule disp_apache2.c>

SetHandler dispatcher-handler

</IfModule>

AllowOverride None

</Directory>

</VirtualHost>

...

...

<VirtualHost 123.45.67.89>

ServerName www.mycompany.com

DocumentRoot /usr/apachecache/docs

<Directory /usr/apachecache/docs>

<IfModule disp_apache2.c>

SetHandler dispatcher-handler

</IfModule>

AllowOverride None

</Directory>

</VirtualHost>

...

Sample Files:

  1. Sample Dispatcher.any file
  2. Most Simple httpd.conf file

Very Simple httpd.conf

ServerName apache

Listen 8082

User apache

ServerRoot /etc/httpd

DocumentRoot /var/www/html

ServerAdmin webmaster@nowhere.com

LoadModule autoindex_module modules/mod_autoindex.so

LoadModule dir_module modules/mod_dir.so

LoadModule dispatcher_module modules/mod_dispatcher.so

LoadModule mime_module modules/mod_mime.so

TypesConfig conf/mime.types

ModMimeUsePathInfo On #Added to resolve issues in dispatcher bug #34466

KeepAlive on

KeepAliveTimeout 15

TimeOut 30

<IfModule disp_apache2.c>

DispatcherConfig conf/dispatcher.any

DispatcherLog logs/dispatcher.log

DispatcherLogLevel 3

DispatcherNoServerHeader 0

DispatcherDeclineRoot 1

DispatcherUseProcessedURL 1

</IfModule>

<Directory />

#Options -Indexes -MultiViews -FollowSymLinks #Note: Allow symlinks if mod_rewrite is needed

AllowOverride None

<IfModule disp_apache2.c>

SetHandler dispatcher-handler

</IfModule>

</Directory>