Wednesday, 6 April 2011

Setting up dispatcher

Here are some pointers to setting up a Day CQ dispatcher

On windows,
In dispatcher.any, set the docroot to something simple like
/docroot "c:/mywork/htdocs/cache"
Change the permissions on this folder so that apache can write to it.

In httpd.conf
DocumentRoot "C:/mywork/htdocs"

If there are rewrite rules required, then remember to turn the RewriteEngine on :-

RewriteEngine on
RewriteRule ^/?$ /content/projectx/en/home.html [QSA,PT,L]
RewriteRule ^(?!/content/)(.*).html$ /content/projectx/en$0 [QSA,PT,L]
RewriteRule ^(/css/).*$ /apps/projectx/docroot$0 [QSA,PT,L]
RewriteRule ^(/js/).*$ /apps/projectx/docroot$0 [QSA,PT,L]
RewriteRule ^(/images/).*$ /apps/projectx/docroot$0 [QSA,PT,L]

If you see the following error in the dispatcher.log :-
[Thu Apr 07 06:54:02 2011] [D] [1780(1444)] Filter rejects GET /css/projectx.css HTTP/1.1

Then the "/filter /glob" section is blocking the retrieval of the page from the publish server.

1 comment:

  1. Question - Have you ever seen the issue where content which is requested returns a 404 because dispatcher cache doesn't have the directory structure for the requested page? As soon as I create the directory in the cache directory for the requested page, then the page will load. Otherwise, returns a 404.
    Apache2.4, Ubuntu Linux, Dispatcher dispatcher-apache2.4-4.1.7.so

    Thanks in advance!

    ReplyDelete