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=

web.server.display.node=true

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.

Another thing about apache is that is sometimes does not provide enough information so first use the “Test Configuration” option the errors are clearly shown here and then you can go ahead and start the apache server from the console.
Have a happy time setting the architecture.

I’m Engaged!

dsc_8646

My lovely Azrina :)

dsc_8705

Hey it's me :p

dsc_8935

We're together :)

Liferay with jQuery Suckerfish Drop Down menu?

You can create your own navigation with suckerfish menu type. All you need to do is to include your jQuery plugin and edit your navigation.vm and change the div id to your suckerfish css id.

Currently i’m using Superfish jQuery manu plugin byJoel Birch. http://users.tpg.com.au/j_birch/plugins/superfish/

1. include all the script in your portal_normal.vm in the theme folder or you can put it in the top_js-ext.jspf file inside \ROOT\html\common\themes, so that you don’t have to include the javascript in every theme folder.



2. Include the new suckerfish navigation css file, same as above or you can copy and paste the whole suckfish css code and paste it in the custom.css in the theme folder.

3. open the navigation.vm in the template directory under theme folder, and change the div id with the new id and change the ul class respective with the new css. eg:

If you want it to be 2 level drop down menu you can use my code :

4. put the jquery function in the javascript text area in your page management:

jQuery(document).ready(function(){
        jQuery("ul.sf-menu").supersubs({
            minWidth:    12,
            maxWidth:    27,
            extraWidth:  1
        }).superfish();
    });

5. Done!, you can edit your css to fit your theme css. Here is example from my portal using the jQuery Superfish plugin with Liferay.

Liferay navigation using Suckerfish plugin

Liferay navigation using Suckerfish plugin

Cool ey? :)

Ready to Engage! 3…2…1… Go!

It’s been a long time I didn’t update my blog, so today I would like to let you know that my engagement ceremony will be held at Kuala Terengganu this Saturday 4th July 2009 (America’s Independence Day).

My dad’s chilis :p

Every 2 weeks I will go back to my hometown which is in Rembau Negeri Sembilan, to relax my mind from over crowded Kuala Lumpur. This is my dad’s farm, and it’s almost 1 year he’d growing the chilies.

rembau my dad farm

view from my house

chili

In the farm

There's my dad

There's my dad

cili

chili

chili

chili

Another Web Template …

schule innovatrice sdn bhd web design

schule innovatrice sdn bhd web design

Another web templates made for my client Schule Innovatrice Sdn Bhd. Most of the content are using jQuery slider effect and flash carousel for the image menu.

Web design trends for 2009

I like to surf online zine for searching fresh idea of web design. One of my favourite online zine is http://www.smashingmagazine.com. They have most of the latest info about web design.

Here i’ve found articles about web design trends for year 2009 —> http://www.smashingmagazine.com/2009/01/14/web-design-trends-for-2009/

alex buga

And one more link that I should share with you guys is Dzine blog. They links to tutorials page for designing nice web layout using photoshop. –> http://dzineblog.com/2009/01/27-best-photoshop-web-layout-design-tutorials-part-2.html

notepad

Paper texture background

As I was searching and asking Mr Google for web background design, i’ve found this great tutorial on how to make a paper texture from scratch and create a grungy web design with it. Even it show how to make a watermark. Really cool!

I think I should share this with you guys.

Check out this link –> Photoshop Paper Texture from Scratch then Create a Grungy Web Design with it!

Yeah!

Yes gaji dah masuk, baya hutang…

Liferay..jQuery?

Spent for 3 hours to figure out why my custom jQuery effect not working in my liferay. Then I’ve found that Liferay developer already change the call function from $ to jQuery. example we alway use:

$(document).ready(function()

but in Liferay u should do like this:

jQuery(document).ready(function()