liferay 6.2-SP10 on JBoss EAP 6.2

Hi All,

I will show you the steps to install liferay 6.2-SP10 on JBoss EAP 6.2

1 - Download the below files:

     - Jboss EAP 6.2 from here and unzip the folder, This directory is referred to as $JBOSS_HOME throughout this section

     - Liferay 6.2-SP10 EE WAR file from here

     - Liferay 6.2-SP10 EE dependencies jars from here

 

2 - Setup the Dependency Jars:

      - Create the folder structure “com/liferay/portal/main” under “$JBOSS_HOME/modules/.

      - Unzip the downloaded Liferay 6.2-SP10 EE dependencies and copy the jars inside the "main" folder created in the previous step.

      - depending on which database you will use, copy the required driver jar file in the "main" folder (I will add the driver for MySQL "mysql-connector-java-5.1.34-bin.jar" , I downloaded that from here , once you download the zip file unzip it and you will find "mysql-connector-java-5.1.34-bin.jar" inside the folder)

     - your "$JBOSS_HOME/modules/com/liferay/portal/main" folder should look like:

  

    - Create the file module.xml in the $JBOSS_HOME/modules/com/liferay/portal/main folder and insert the below contents, you can change mysql driver version depending on which one you want to use and you add it to the "main" folder (or remove it if you will not use MySQL) also inlude "<resource-root path="hsql.jar" />" even if you will not use hsql database.

=========================================

     <?xml version="1.0"?>

<module xmlns="urn:jboss:module:1.0" name="com.liferay.portal">
    <resources>
        <resource-root path="hsql.jar" />
        <resource-root path="mysql-connector-java-5.1.34-bin.jar" />
        <resource-root path="portal-service.jar" />
        <resource-root path="portlet.jar" />
    </resources>
    <dependencies>
        <module name="com.liferay.portal" />
        <module name="javax.api" />
        <module name="javax.mail.api" />
        <module name="javax.servlet.api" />
        <module name="javax.servlet.jsp.api" />
        <module name="javax.transaction.api" />
    </dependencies>
</module>

============================================

 

3 - configure Jboss:

Please edit/add the below in "$JBOSS_HOME/standalone/configuration/standalone.xml". file.

 

  -  Add the below between the </extensions> and <management>:


 ==========================
  <system-properties>
        <property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
        <property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>
</system-properties>
 =========================


 -  Add the attribute deployment-timeout=”240” in the “<deployment-scanner” tag:


 ====================
 <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" deployment-timeout="240"/>
 ====================


 -  Add the below security domain to the security subsystem <security-domains> defined in element <subsystem xmlns="urn:jboss:domain:security:1.2">


 =====================
<security-domain name="PortalRealm">
    <authentication>
       <login-module code="com.liferay.portal.security.jaas.PortalLoginModule" flag="required" />
    </authentication>
</security-domain>
 ====================


 -  Disable welcome root of the web subsystem’s virtual server default host by specifying enable-welcome-root="false".


 =========================
<subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="default-host" native="false">
    <configuration>
          <jsp-configuration development="true"/>
    </configuration>
    <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
    <virtual-server name="default-host" enable-welcome-root="false">
       <alias name="localhost" />
       <alias name="example.com" />
    </virtual-server>
</subsystem>
 ========================


 - Add the following <configuration> element inside the web subsystem element <subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="default-host" native="false">

 

==============
<configuration>
        <jsp-configuration development="true"/>
</configuration>
 ===============

 

4 - Modify the startup script:

 a) if you are working on linux machine, remove everything in file "standalone.conf" at  "$JBOSS_HOME/bin/" folder and replace it with the below:

===========================================================

## -*- shell-script -*- #########################
##                                                                          ##
##  JBoss Bootstrap Script Configuration                                   
##                                                                          ##
#########################################

#
# This file is optional; it may be removed if not needed.
#

#
# Specify the maximum file descriptor limit, use "max" or "maximum" to use
# the default, as queried by the system.
#
# Defaults to "maximum"
#
#MAX_FD="maximum"

#
# Specify the profiler configuration file to load.
#
# Default is to not load profiler configuration file.
#
#PROFILER=""

#
# Specify the location of the Java home directory.  If set then $JAVA will
# be defined to $JAVA_HOME/bin/java, else $JAVA will be "java".
#
#JAVA_HOME="/opt/java/jdk"

#
# Specify the exact Java VM executable to use.
#
#JAVA=""

if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman"
fi

# Uncomment the following line to prevent manipulation of JVM options
# by shell scripts.
#
#PRESERVE_JAVA_OPTS=true

#
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS -Djboss.server.default.config=standalone.xml"
else
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
fi

# Sample JPDA settings for remote socket debugging
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

# Sample JPDA settings for shared memory debugging
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"

# Uncomment to not use JBoss Modules lockless mode
#JAVA_OPTS="$JAVA_OPTS -Djboss.modules.lockless=false"

# Uncomment to gather JBoss Modules metrics
#JAVA_OPTS="$JAVA_OPTS -Djboss.modules.metrics=true"



JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true  -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"

=================================================================

  b)If you are working on windows machine edit "standalone.conf.bat" at  "$JBOSS_HOME/bin/" folder with the below:

   - Comment out the initial JAVA_OPTS assignment as demonstrated in the following line:
 
    rem set "JAVA_OPTS=-Xms64M -Xmx512M -XX:MaxPermSize=256M"
 
   - Add the following JAVA_OPTS assignment one line above the :JAVA_OPTS_SET line found at end of the file:


 ===================
    set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djava.security.manager -Djava.security.policy=$JBOSS_HOME/bin/server.policy -Djboss.home.dir=$JBOSS_HOME -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"

====================

 

4 - Deploy Liferay war
 
  - Create a folder “ROOT.war” under the “$JBOSS_HOME/standalone/deployments/” location.

  - Unzip the Liferay 6.2-SP10 EE WAR file into the ROOT.war folder.

  - Create an empty file named ROOT.war.dodeploy in the same "$JBOSS_HOME/standalone/deployments/" folder.

  - Start  JBoss server: go to /jboss-eap-6.2/bin and run "./standalone.sh"

 

Enjoy :-)

 

 

 

 

 

Blogs
why do you have to keep the hsql jar ? even the official documentation from the customer portal says that you dont need to keep the hsql.jar, anyway... ive deployed liferay 6.2 sp13 EE on jboss EAP 6.1.1 but as you mentioned i had to keep the hsql.jar, i just want to know why is that

thanks in advance
- Alan