Liferay:Setting up 3 tier architechture with Apache(Using mod_jk) & Tomcat
This configuration i’ve taken from Abhinao Shrivastav’s blog, credit to him
STEP 1:
Download and install the following, each on a different server:
Server A - Apache 2.2
Server B - Tomcat1 (Liferay-tomcat bundle)
You shouldn’t have changed any of the configurations. I would assume that your liferay is up and ready now and you are able to ping liferay and login to that.
STEP 2:
Download and install the mod_jk shared object file into Server A - $Apache_2.2_HOME/modules/
I renamed my mod_jk file so now I have a mod_jk.so in $Apache_2.2_HOME/modules/. After you’ve installed mod_jk into the Apache server, you can continue to the next step.
STEP 3:
Create httpd-mod_jk.conf in $Apache_2.2_HOME/conf/extras. Paste these contents into httpd-mod_jk.conf:
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogStampFormat “[%a %b %d %H:%M:%S %Y] ”
JkLogLevel info
JkShmFile logs/jk-runtime-status
Note:
“LoadModule jk_module modules/mod_jk.so” - loads mod_jk.so so that you could use mod_jk arguments.
“JkWorkersFile conf/workers.properties” - specifies location of workers.properties file where the load balancer and any servers involved with the cluster are defined.
STEP 5:
Create workers.properties in $Apache_2.2_HOME/conf/. Paste these contents in there:
worker.properties:
worker.list=portal-01,loadbalancer
worker.portal-01.port=8009
worker.portal-01.host=
worker.portal-01.type=ajp13
worker.portal-01.cachesize=10
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=portal-01
worker.loadbalancer.sticky_session=1
JkMount /* portal-01
JkMount is a pretty important line and without that you will not see the fruits of the labour that you have put in defining the settings. So don’t miss it.
Note:
I’ve designated Server B and Server C to be my Liferay servers, an in worker.properties I’ve given Server B a symbolic name (portal-01) as well as Server C (portal-02). You can give your servers any symbolic name so long as they are consistent!
Also make sure that the port and host for each server configuration in workers.properties is consistent with the server itself.
STEP 6:
Modify $Apache_2.2_HOME/conf/extras/httpd-vhosts.conf
Make a backup of httpd-vhosts.conf. The contents of httpd-vhosts.conf should now just consist of:
NameVirtualHost *:80
JkMount /* loadbalancer
This makes it so that anytime the localhost url of Server A is hit, the load balancing mechanism will control whether the user will actually go to Server B or Server C.
STEP 7:
In Apache’s httpd.conf we need to include our new httpd-mod_jk.conf and our modified httpd-vhosts.conf.
Uncomment the following in $Apache_2.2_HOME/conf/httpd.conf:
#Include conf/extra/httpd-vhosts.conf
Append the following in $Apache_2.2_HOME/conf/httpd.conf:
Include conf/extra/httpd-mod_jk.conf
Restart Apache.
STEP 8:
In httpd-mod_jk.conf add the
STEP 9:
Paste this into portal-ext.properties for Tomcat and add the below entries:
web.server.host=
web.server.port=
The liferay settings are pretty important I struggled quite a bit without this setting and it will be good if you can identify the host with a name because liferay uses these to create the URL.


















Talk to My Wall RSS Feed

