Showing posts with label how to configure Dispatcher in AEM. Show all posts
Showing posts with label how to configure Dispatcher in AEM. Show all posts

Tuesday, 18 August 2015

Dispatcher Configuration on Apache2 Server

In this blog, I will explain the easiest way of dispatcher configuration on Apache2 Server and OS version Ubuntu 15.04. This configuration will also work on Ubuntu 14.04.

Let's start:-
Firstly, you have to install Apache2 server on your Ubuntu machine using this command-
sudo apt-get install apache2

Now type the command-
sudo service apache2 start

Now hit a url in a web browser-
http://localhost

You will get apache2 welcome screen as shown in figure-


Now download the dispatcher package from this link-
https://www.adobeaemcloud.com/content/companies/public/adobe/dispatcher/dispatcher.html

If you are using the apache2 version 2.4.10, you have to download dispatcher version 4.1.9
Extract this *.tar.gz file, You will get a folder named as dispatcher-apache2.4-linux-x86-64-4.1.9.

In this folder you have a file dispatcher-apache2.2-4.1.9.so file, just rename this file with dispatcher.so
The location of this file will be like as shown in figure-

Copy and paste this dispatcher.so file to /usr/lib/apache2/modules as shown in figure-


Before paste this file into this directory you have to change the permission of the directory using this command-
sudo chmod 777 -R /usr/lib/apache2/modules






Now copy an another file named as dispatcher.any file from dispatcher-apache2.4-linux-x86-64-4.1.9/conf directory and paste to the etc/apache2/conf-available directory.
Again, if you can't paste this file into this directory  you have to change the permission of the directory using this command-
sudo chmod 777 -R /etc/apache2

Now you can easily paste your file in this directory and all those directories which are placed into appache2 directory. The location of this directory is shown in figure-
"In this file you have to change the port number to 4503 as the default number 8080".





After this, you have to create a soft link of dispatcher.any file into the conf-enabled directory using this cammand-
ln -s /etc/apache2/conf-available/dispatcher.any /etc/apache2/conf-enabled/dispatcher.any



 It will look like this-









Now create a dispatcher.load file in mods-available folder and write a line in this file-
LoadModule dispatcher_module /usr/lib/apache2/modules/dispatcher.so

It will look like this-


"Note: - This file will be used to load dispatcher module on Apache2 server".

Now create a soft link in mods-enabled directory using this command-
ln -s /etc/apache2/mods-available/dispatcher.load /etc/apache2/mods-enabled/dispatcher.load

It will look like this-

Now open apache2-conf file which is placed in etc/apache2 directory and search for the Directory tag. Here you have to add one more directory tag as given below-

<Directory />
  <IfModule disp_apache2.c>
   SetHandler dispatcher-handler
  </IfModule>
  Options FollowSymLinks
  AllowOverride None
</Directory>

Now open ports.conf file & add these some line at the end of the file-

<IfModule disp_apache2.c>
     DispatcherConfig conf-enabled/dispatcher.any
     DispatcherLog    logs/dispatcher.log
     DispatcherLogLevel 3
     DispatcherNoServerHeader 0
     DispatcherDeclineRoot 0
     DispatcherUseProcessedURL 0
     DispatcherPassError 0
</IfModule>

Now go to /etc directory and open hosts file using this command-
sudo gedit /etc/hosts

Add one more line in this file-
127.0.0.1       publish.sjigaurav.com

You can add anything whatever you want at the place of publish.sjigaurav.com.

Now configuration is complete you can restart your apache2 server using this command-
sudo service apache2 restart

Go to your web browser and hit the url publish.sjigaurav.com you will find the welcome screen.
It starts successfully.



Be Happy