Setup Jboss Ent. With Liferay Portal

My Environment

Jboss Boss AS Ent. 4.3.0.G.A

LifeRay Portal 4.4.2

MySql 5.0.45 community

(Linux and Windows almost use the same setting steps)

1. run the Jboss AS installer to install it.

Windows : double click

Linux : terminal>java -jar enterprise-installer-4.3.0.GA-1.ep1.8.jar

2. install MySql from its installer.

3. download 3 files of liferay :

liferay-portal-4.4.2-with-dependencies.war

liferay-portal-dependencies-4.4.2.zip

liferay-portal-sql-4.4.2.zip

4. create an utf-8 database in your mysql, I use lportal as database name here.

mysql>create database lportal character set utf8;

5. unpack liferay-portal-sql-4.4.2.zip, import the database dump under [unpack]/create-minimal/create-minimal-mysql.sql

mysql -uroot lportal < [path from above]/create-minial-mysql.sql –default-character-set=utf8

6. open [JBOSS_HOME]/jboss-as/server/default/deploy/jboss-web.deployer/conf/web.xml

Replace :

<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

With :

<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servletclass>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>input</param-name>
<param-value>4096</param-value>
</init-param>
<init-param>
<param-name>output</param-name>
<param-value>4096</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

7. create [JBOSS_HOME]/jboss-as/server/default/deploy/liferay-ds.xml

<?xml version="1.0"?>
<datasources>
	<local-tx-datasource>
		<jndi-name>jdbc/LiferayPool</jndi-name>
		<connection-url>jdbc:mysql://hostname:3306/lportal</connection-url>
		<driver-class>com.mysql.jdbc.Driver</driver-class>
		<user-name></user-name>
		<password></password>
		<min-pool-size>5</min-pool-size>
	</local-tx-datasource>
</datasources>

8. Download mysql-connector-java-5.1.5-bin.jar, copy to [JBOSS_HOME]/jboss-as/server/default/lib/

9. Unpack liferay-portal-dependencies-4.4.2.zip to [JBOSS_HOME]/jboss-as/server/default/lib/

resulting structure will be like this :

[JBOSS_HOME]/jboss-as/server/default/lib/liferay-portal-dependencies-4.4.2/portlet.jar

/portal-kernel.jar

/portal-service.jar

10 .Setup mail properties, open [JBOSS_HOME]/jboss-as/server/default/deploy/mail-service.xml

modify : User, Password, pop3.host, smtp.host, mail.from

11. Open [JBOSS_HOME]/jboss-as/server/default/conf/login-config.xml, comment out the entire <application-policy name=”other”>

12. unpack liferay-portal-4.4.2-with-dependencies.war, rename the unpacked folder to liferay-portal.war

Move dom4j.jar, jaxen.jar from liferay-portal.war/WEB-INF/lib to [JBOSS_HOME]/jboss-as/lib

Move commons-collections.jar from liferay-portal.war/WEB-INF/lib to [JBOSS_HOME]/jboss-as/server/default/lib (overwrite it if it is already there)

remove hibernate3.jar, jboss-hibernate.jar from [JBOSS_HOME]/jboss-as/server/default/lib

Move liferay-portal.war to [JBOSS_HOME]/jboss-as/server/default/deploy/

13. open [JBOSS_HOME]/jboss-as/server/default/deploy/jbossjca-service.xml

change <attribute name=”Debug”>true</attribute>

to <attribute name=”Debug”>false</attribute>

14. open [JBOSS_HOME]/jboss-as/server/default/deploy/jboss-messaging.sar/destinations-service.xml

clear all text between <server></server>

15. open [JBOSS_HOME]/jboss-as/bin/run.conf

modify the JAVA_OPTS setting to this one

      JAVA_OPTS="-Xms256m -Xmx512m -XX:MaxNewSize=256m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

16. But in my experience, JBoss Ent. may not pick up this setting in windows, so

Windows : open [JBOSS_HOME]/jboss-as/bin/run.bat

find : rem JVM memory allocation pool parameters. Modify as appropriate.

change the line follow this one to

set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx512m -XX:MaxNewSize=256m -XX:MaxPermSize=256m

17. start Jboss AS, beware that there are more then one AS : All, default, minimal, production.

The one we setup is default, you can start by

Windows : [JBOSS_HOME]/jboss-as/bin/run.bat -c default

Linux : [JBOSS_HOME]/jboss-as/bin/run.sh -c default

18. open http://localhost:8080, you should see liferay running

19. change the Jboss AS to allow remote connection and bind to port 80

open [JBOSS_HOME]/jboss-as/server/default/deploy/jboss-web.deployer/server.xml

change :

    <Connector port="8080" address="${jboss.bind.address}"
         maxThreads="250" maxHttpHeaderSize="8192"
         emptySessionPath="true" protocol="HTTP/1.1"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" />

to :

    <Connector port="80" address="0.0.0.0"
         maxThreads="250" maxHttpHeaderSize="8192"
         emptySessionPath="true" protocol="HTTP/1.1"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" />

Then reboot JBoss AS.

Advertisements

2 thoughts on “Setup Jboss Ent. With Liferay Portal

  1. Dear 麥克斯,
    參觀你的部落格受易良多,謝謝你。
    請教一下:
    您的程式碼有行號
    是如何作的,能教我嗎?
    我的mail:arvin@wezoomtek.com.tw

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s