{"id":11008,"date":"2013-10-14T22:24:47","date_gmt":"2013-10-14T16:54:47","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=11008"},"modified":"2017-04-24T16:07:40","modified_gmt":"2017-04-24T10:37:40","slug":"aem-dispatcher-setup-for-linux","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/aem-dispatcher-setup-for-linux\/","title":{"rendered":"AEM Dispatcher setup for Linux"},"content":{"rendered":"<p>Installing dispatcher for <a title=\"CQ5 Consulting\" href=\"http:\/\/www.tothenew.com\/wcm\/cq-aem-development-consulting\">AEM<\/a> in Apache Web-server in Linux may get little tricky, as documentation provided by Adobe on <a title=\"Installation of Dispatcher\" href=\"http:\/\/dev.day.com\/docs\/en\/cq\/current\/deploying\/dispatcher\/disp_install.html\" target=\"_blank\">Installation of Dispatcher<\/a> in Linux is not sufficient, and if we take it in analogy and try doing same way we do in Windows, then we face some issues locating the appropriate files.<\/p>\n<p><strong><span style=\"text-decoration: underline;\">Prerequisites for Dispatcher Setup<\/span><\/strong><\/p>\n<ul>\n<li>Apache 2.2 web server &#8211; In Ubuntu 12.0 and higher, Apache 2.2 webserver is pre-installed, but in case it is not there, you can find the installation instructions here.<\/li>\n<li>Dispatcher Module &#8211; Appropriate dispatcher module can be downloaded from <a title=\"Adobe Package Share\" href=\"https:\/\/www.adobeaemcloud.com\/content\/companies\/public\/adobe\/dispatcher\/dispatcher.html\" target=\"_blank\">Adobe Package Share<\/a>.<\/li>\n<\/ul>\n<p><span style=\"text-decoration: underline;\"><strong>Installation Instructions<\/strong><\/span><\/p>\n<ol>\n<li>Considering Apache web server is already setup in the system, go ahead and extract dispatcher module using the following command:\n<pre><code> tar -xvzf &lt;dispatcher..xxxx..yyyy.tar.gz&gt;<\/code><\/pre>\n<\/li>\n<li>Once you have extracted the files, now you have to move the appropriate files to their respective apt path.<\/li>\n<li>Move &#8220;dispatcher-apache2.x-4.1.x.so&#8221; to &#8220;\/usr\/lib\/apache2\/modules&#8221;. There you will find all the modules already being loaded by apache 2 webserver.<\/li>\n<li>Adobe recommends to give a soft name to your dispatcher module, but you don&#8217;t need it as once setup is done, you will be hardly using it again.<\/li>\n<li>Now go ahead and create a folder conf under &#8220;\/etc\/apache2\/&#8221;, and move &#8220;dispatcher.any&#8221; file under this folder. Make sure that you don&#8217;t move your dispatcher.any file to &#8216;conf.d&#8217; folder which is already present.<\/li>\n<li>Now is the time to edit and map module file that you added and map the dispatcher.any file. Go ahead and edit apache2.conf file present under &#8220;etc\/apache2\/&#8221;.<\/li>\n<li>Scroll to the end, put some nice comments about you adding some new configs, and add following:\n<pre><code>LoadModule dispatcher_module \/usr\/lib\/apache2\/modules\/dispatcher-apache2.2-4.1.5.so\r\n\r\n&lt;IfModule disp_apache2.c&gt;\r\n# location of the configuration file. eg: 'conf\/dispatcher.any'\r\nDispatcherConfig conf\/dispatcher.any\r\n\r\n# location of the dispatcher log file. eg: 'logs\/dispatcher.log'\r\nDispatcherLog \/var\/log\/apache2\/dispatcher.log\r\n\r\n# log level for the dispatcher log\r\n# 0 Errors\r\n# 1 Warnings\r\n# 2 Infos\r\n# 3 Debug\r\nDispatcherLogLevel 3\r\n\r\n# if turned to 1, the dispatcher looks like a normal module\r\nDispatcherNoServerHeader 0\r\n\r\n# if turned to 1, request to \/ are not handled by the dispatcher\r\n# use the mod_alias then for the correct mapping\r\nDispatcherDeclineRoot 0\r\n\r\n# if turned to 1, the dispatcher uses the URL already processed\r\n# by handlers preceeding the dispatcher (i.e. mod_rewrite)\r\n# instead of the original one passed to the web server.\r\nDispatcherUseProcessedURL 0\r\n\r\n# if turned to 1, the dispatcher does not spool an error\r\n# response to the client (where the status code is greater\r\n# or equal than 400), but passes the status code to\r\n# Apache, which e.g. allows an ErrorDocument directive\r\n# to process such a status code.\r\nDispatcherPassError 0\r\n&lt;\/IfModule&gt;\r\n\r\n<\/code><\/pre>\n<\/li>\n<li>Also add the following config to the end of apache2.conf file, which loads the dispatcher in web-server.\n<pre><code><span style=\"font-family: monospace, serif;\">&lt;Directory \/&gt;<\/span>\r\n\r\n<\/code><span style=\"font-family: monospace, serif;\">&lt;IfModule disp_apache2.c&gt; \r\n<\/span><span style=\"font-family: monospace, serif;\"># enable dispatcher for ALL request. if this is too restrictive, \r\n<\/span><span style=\"font-family: monospace, serif;\"># move it to another location\r\n<\/span><span style=\"font-family: monospace, serif;\">SetHandler dispatcher-handler\r\n<\/span><span style=\"font-family: monospace, serif;\">&lt;\/IfModule&gt;\r\n<\/span><span style=\"font-family: monospace, serif;\">\r\nOptions FollowSymLinks\r\n<\/span><span style=\"font-family: monospace, serif;\">AllowOverride None\r\n<\/span><span style=\"font-family: monospace, serif;\">\r\n&lt;\/Directory&gt;<\/span><\/pre>\n<\/li>\n<li><span style=\"line-height: 1.5;\">Comments given above are self-explanatory but, you can still go and edit configs if needed as per following descriptions:<\/span>\n<ul>\n<li>DispatcherConfig: Location and name of the configuration file (Can be given as an absolute or relative path)<\/li>\n<li>DispatcherLog: Location and name of the log file (Can be given as an absolute or relative path)<\/li>\n<li>DispatcherLogLevel: Log level for the log file<\/li>\n<li>DispatcherNoServerHeader: Whether to use the Apache or CQ server header<\/li>\n<li>DispatcherDeclineRoot: Defines whether to decline requests to the root \u201c\/\u201d<\/li>\n<li>DispatcherUseProcessedURL: Defines whether to use the original request URL or to use one already processed by other handlers (ie: <a href=\"http:\/\/httpd.apache.org\/docs\/current\/mod\/mod_rewrite.html\" target=\"_blank\">mod_rewrite<\/a>)\n<ul>\n<li>Note: This is essential for rewriting incoming links (stripping away the \u2018content\/{site_name}\u2019)<\/li>\n<\/ul>\n<\/li>\n<li>DispatcherPassError: Defines whether CQ or Apache will handle HTTP 40x error codes<\/li>\n<li><a href=\"http:\/\/httpd.apache.org\/docs\/2.2\/mod\/core.html#sethandler\" target=\"_blank\">SetHandler<\/a> (Apache parameter): Forces all matching files to be processed by a handler<\/li>\n<\/ul>\n<\/li>\n<li><span style=\"line-height: 1.5;\">Make sure, that path that is provided for load module, matches with the path where you placed your dispatcher module. Also match the name and version of dispatcher module, and change the config as required.<\/span><\/li>\n<li>Now configure dispatcher.any file. Edit \/renders section in dispatcher.any.\n<pre><code>\r\n\/renders\r\n{\r\n\/rend01\r\n{\r\n\/hostname \"localhost\"\r\n[2]--&gt; \/port \"80\"\r\n}\r\n}\r\n\/cache\r\n{\r\n\/docroot \"\/var\/cache\/apache2\/&lt;cqcache&gt;\"\r\n}\r\n<\/code><\/pre>\n<p>By default you may find port set to 8000 or 8080, change it to 80.<br \/>\nGive whatever soft-name you want to give to your cache folder in place of &#8220;cqcache&#8221;<\/li>\n<li>Restart the apache server to let web server take effect. You can restart apache server by using the following command:\n<pre><code>\r\nsudo \/etc\/init.d\/apache2 restart\r\n<\/code><\/pre>\n<\/li>\n<li>Once the server is restarted and you get [OK] message, go and check \/var\/log\/apache2\/dispatcher.log file. If it says dispatcher initialized with correct cache path, it means dispatcher is successfully setup and ready to be used.<\/li>\n<\/ol>\n<p>Now you just need to configure your CQ replication agent, and point dispatcher flush agents to correct port.<\/p>\n<p>I tested this today itself i.e. 14th Oct 2013 on Ubuntu 13 64 bit debian based OS. It worked like wonder for me. Please post your comments and queries if you have any issues with it, and also if there are better ways to do it. \ud83d\ude09 Cheeeerz.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing dispatcher for AEM in Apache Web-server in Linux may get little tricky, as documentation provided by Adobe on Installation of Dispatcher in Linux is not sufficient, and if we take it in analogy and try doing same way we do in Windows, then we face some issues locating the appropriate files. Prerequisites for Dispatcher [&hellip;]<\/p>\n","protected":false},"author":81,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":166},"categories":[1],"tags":[4847,18,1207,1205,1233,649,260,1237,1234],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/11008"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=11008"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/11008\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=11008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=11008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=11008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}