Wednesday, March 2, 2016

deploy liferay EE into Jboss 6 EAP manually

i am using Jboss EAP 6.4
with java 1.7.0_79
and for liferay, i am deploying Liferay Portal 6.2 EE SP14
with Liferay Portal 6.2 EE SP14 Dependencies
the dependencies is needed in order for liferay to run if you build yourself

unzip the jboss eap and install the java
create a folder call liferay and put extracted jboss into it

for mine, i put the liferay at /opt , it will look like this

1. deploy dependencies

cd to jboss folder and make new dir like this

unzip liferay-portal-dependencies-6.2-ee-sp14 and put all into <jboss>/modules/com/liferay/portal/main
put the mysql connector there as well if you using mysql

at the same directory, create a file name module.xml
and put this into it

<?xml version="1.0"?>

<module xmlns="urn:jboss:module:1.0" name="com.liferay.portal">
                <resource-root path="hsql.jar" />

                <resource-root path="portal-service.jar" />
                <resource-root path="portlet.jar" />
                <resource-root path="mysql-connector-java-5.1.38-bin.jar" />
                <module name="ibm.jdk" />
                <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" />

please edit the mysql name to match yours

2. Jboss configuration

part 1

go to liferay/jboss/standalone/configuration/
and edit standalone.xml
between the  </extensions> and <management> (note: should be around line 27 - 30 )
add this into it

        <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"/>

part 2

then search deployment-scanner
and add deployment-timeout="240"

it will look something like this
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" deployment-timeout="240"/>

part 3

then search for <subsystem xmlns="urn:jboss:domain:security:1.2">
and add this into it

<security-domain name="PortalRealm">
       <login-module code="" flag="required" />

it will look something like this

        <subsystem xmlns="urn:jboss:domain:security:1.2">
                <security-domain name="other" cache-type="default">
                        <login-module code="Remoting" flag="optional">
                            <module-option name="password-stacking" value="useFirstPass"/>
                        <login-module code="RealmDirect" flag="required">
                            <module-option name="password-stacking" value="useFirstPass"/>
                <security-domain name="jboss-web-policy" cache-type="default">
                        <policy-module code="Delegating" flag="required"/>
                <security-domain name="jboss-ejb-policy" cache-type="default">
                        <policy-module code="Delegating" flag="required"/>
                <security-domain name="PortalRealm">
                        <login-module code="" flag="required" />

part 4

search enable-welcome-root and change it to false

<virtual-server name="default-host" enable-welcome-root="false">

3. deploy Liferay war

create ROOT.war folder in liferay/jboss/standalone/deployments
extract the Liferay .war file into the ROOT.war folder

# jar -xvf liferay.war

at the same level with ROOT.war, create empty file call ROOT.war.dodeploy
# touch ROOT.war.dodeploy

In the ROOT.war file, open the WEB-INF/jboss-deployment-structure.xml file. In this file, replace the <module name="com.liferay.portal" /> dependency with the following configuration:

<module meta-inf="export" name="com.liferay.portal">
        <include path="META-INF" />

This allows OSGi plugins like Audience Targeting to work properly, by exposing the Portal API through the OSGi container.

1. (must login liferay first)

1 comment:

  1. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor led live training in JBoss, kindly contact us
    MaxMunus Offer World Class Virtual Instructor led training on JBoss. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Nitesh Kumar
    Skype id: nitesh_maxmunus
    Ph:(+91) 8553912023