Thursday, October 9, 2008

Deploy Liferay 5.1.2 to IBM WebSphere 6.1.x


Install a new IBM WebSphere Application Server (WAS) 6.1 to c:\was61 by running launchpad.exe
No need to install sample applications
Do not enable admin security for simplicity


Create a MySQL database (Only for demo purposes, Liferay can also work with existing databases)
- Download non-installer version of MySQL 5.0.67 from www.mysql.com (http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-noinstall-5.0.67-win32.zip/from/http://mysql.mirror.ac.za/)
- Extract mysql-noinstall-5.0.67-win32.zip to c:\mysql
- start mysql by running "c:\mysql\bin\mysqld"
- Create lportal database by running "c:\mysql\bin\mysql -h localhost -u root -p", then run "create database lportal;"
Obtain MySQL JDBC driver
- Copy mysql-connector-java-5.0.8-bin.jar to c:\was61\lib\ext (Later version can also be used)
Start WAS using Start -> Programs -> IBM WebSphere -> Profiles -> AppSrv001 -> Start the server
Go to admin console using Start -> Programs -> IBM WebSphere -> Profiles -> AppSrv001 -> Administrative Console
When a browser starts, click "Log in" button while leaving User ID blank
Delete all application
to avoid context root conflict with Liferay
- Click Applications -> Enterprise Applications
- Select all listed applications and then click Uninstall
- Click on Save when prompted
Create a MySQL data source for Liferay runtime
- While on Administrative Console, click Resources -> JDBC -> JDBC Providers
- Choose ...server1 for scope from the dropdown list box
- Click New
- Select "User-defined" for Database Type
- Enter (No quotes) "com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource" for Implementation class name
- Set Name to "MySQL JDBC Provider"
- Click Next
- Clear the text box for Class path
- Click Next and then Finish
- On the left hand navigation, click JDBC Providers
- Choose "MySQL JDBC Provider"
- Click "Data sources" under Additional Properties on the right hand side
- Click New
- For Data source name, type "LiferayDataSource"
- For JNDI name, type "jdbc/LiferayPool"
- Click Next, click Next, click Finish
- Click Data sources from the breadcrumbs (which should be JDBC providers > MySQL JDBC Provider > Data sources > LiferayDataSource)
- Click Custom properties under Additional Properties on the right side
- Delete all property items by selecting them and clicking Delete
- Click New
- Type user for Name, and root for Value, click OK
- Click New, type serverName for Name and localhost for Value, click OK
- Click New, type databaseName for Name and lportal for Value, click OK
- Save when prompted
- Click LiferayDataSource from the breadcrumbs, click Test connection button to test
Create a mail session for Liferay runtime
- Click Resources -> Mail -> Mail sessions
- For Scope, choose ...Server=server1
- Click New
- Set Name to LiferayMail
- Set JNDI name to mail/LiferayMailSession
- Click OK, click Save when prompted
Deploy Liferay 5.1.2
- Obtain liferay-portal-5.1.2.war from Liferay.com or Sourceforge.net
- Still in the Admin Console, click Applications -> Install New Application
- Browse for the war file that was downloaded earlier
- Type / for Context root
- Click Next, click Next
- Choose LiferayDataSource and LiferayMailSession
- Click Next and Finish
- Wait until the deployment is complete and save when prompted
Install Liferay 5.1.2 dependency files
- Obtain liferay-portal-dependencies-5.1.2.zip
- Extract this ZIP file to c:\was61\lib\ext
- Make sure all jars are immediately under c:\was61\lib\ext since Winzip keeps them in a folder by default
Copy icu4j.jar to c:\was61\java\jre\lib\ext
- icu4j.jar should be able to be found somewhere in installedApps folder
- Copy to c:\was61\java\jre\lib\ext
Move portlet.jar to c:\was61java\jre\lib\ext
- Locate portlet.jar at c:\was61\lib\ext
- Move it to c:\was61java\jre\lib\ext (You may have stop the server first)
Copy commons-annotation.jar to c:\was61\lib\ext
- Obtain commons-annocation.jar, preferrably from Spring 2.5.5 distribution
- Copy it to c:\was61\lib\ext
Change memory settings
- Go back to Admin Console
- Click Servers -> Application Servers -> server1 -> Java and Process Management -> Process Definition -> Java Virtual Machine
- Type 256 for Initial Heap Size
- Type 512 for Maximum Heap Size (Windows might have a restriction of 1024, more than this could prevent WAS from restarting)
- Click OK and save as required
restart WAS
- Start -> Programs -> IBM WebSphere -> Profiles -> AppSrv001 -> Stop the server
- Start -> Programs -> IBM WebSphere -> Profiles -> AppSrv001 -> Start the server
Test by go to http://localhost:9080 and login as test@liferay.com and password test

3 comments:

لالة الحادكة said...

hi simon,

i found your interresting article on the net, regarding the installation of Liferay5.1 upon Websphere6.1...
i follow all steps one by one, until the one you suggest to copy the common-annotations.jar to the was/lib/ext unfortunately i dont' find any file with this name in the spring distribution bundle, so i guess that youy mean hibernate-common-annotations.jar, but it does not work !!!

can you please give more information about where to find this file, and if it still necessary.
thank you for your help.

for information, here is the stack trace of the error while tryning to access the Liferay appilcation.

" Error 500: Filter [Session Id Filter]: com.liferay.portal.servlet.filters.sessionid.SessionIdFilter was found, but is missing another required class. "

PLz sends me the document installation /configuration of Liferay5.1.2 and WebSphere6.1.

Simon Wang said...

Hello Kamal, if you download a Spring 2.5.5 distribution with dependencies, it should be under the lib/j2ee directory.

لالة الحادكة said...

thank you Simon for you precious help, finally i succeed to run Liferay5.1 on WAS6.1, i am happy :)