Deploying DXP 7.0 on JBoss EAP 7.0

This article documents how to set up Liferay Digital Experience Platform (DXP) 7.0 on JBoss EAP 7.0.

Administrators and developers familiar with JBoss EAP 6.x products will note that the installation steps are more or less the same in JBoss EAP 7.0. For more information on what has changed see Red Hat's announcement Announcing JBoss EAP 7 and the official release notes.

Resolution

Requirements

  1. Oracle JDK 1.8.
  2. JBoss EAP 7.0 zip bundle or extracted from an installer jar available from the Red Hat site.
  3. Download the following from the Liferay DXP 7.0 Downloads Page:
    1. DXP 7.0 WAR
    2. Dependencies zip
    3. OSGi Dependencies
    4. A database jar (e.g. MySQL, MariaDB, SQL Server)

Installation

Liferay Home is one folder above JBoss's install location. Liferay Home refers to the folder containing the JBoss server folder; it will be shortened to ${JBoss_Home}. When Liferay Digital Enterprise 7.0 is installed on JBoss, the Liferay Home folder contains the JBoss server folder as well as data, deploy, logs, and osgi folders.

  1. Create the folder $JBOSS_HOME/modules/com/liferay/portal/main. Unzip the Liferay Digital Enterprise 7.0 Dependencies zip file and copy the .jar files to this folder.
  2. Place the database .jar in this folder.
  3. Create the file module.xml in the $JBOSS_HOME/modules/com/liferay/portal/main folder and insert the following contents:
    	<?xml version="1.0"?>
    
    	<module name="com.liferay.portal" xmlns="urn:jboss:module:1.0">
        	<resources>
            	<resource-root path="com.liferay.registry.api.jar" />
            	<resource-root path="${database jar}" />
            	<resource-root path="portal-kernel.jar" />
            	<resource-root path="portlet.jar" />
        	</resources>
        	<dependencies>
            	<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>
    
  4. Create an osgi folder in the Liferay Home folder. Then extract the OSGi ZIP file into the osgi folder.

Next, modify the $JBOSS_HOME/standalone/configuration/standalone.xml file.

  1. Remove the unnecessary welcome-content in the web subsystem's undertow:3.1 by deleting the element <location name="/" handler="welcome-content"/>. Delete the corresponding element: <handlers> ... </handlers>. Otherwise, the app server will load the contents of this folder, not Liferay Digital Enterprise 7.0.
    Note that the Web Server in JBoss EAP 6.x has been superseded by Undertow. See Configuring the Web Server Undertow.
    	<subsystem xmlns="urn:jboss:domain:undertow:3.1">
                <buffer-cache name="default"/>
                <server name="default-server">
                    <http-listener name="default" socket-binding="http" redirect-socket="https"/>
                    <host name="default-host" alias="localhost">
                        <filter-ref name="server-header"/>
                        <filter-ref name="x-powered-by-header"/>
                    </host>
                </server>
                <servlet-container name="default">
                    <jsp-config/>
                    <websockets/>
                </servlet-container>
                <filters>
                    <response-header name="server-header" header-name="Server" header-value="JBoss-EAP/7"/>
                    <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
                </filters>
            </subsystem>
    
  2. Find the <jsp-config/> tag and set the development attribute. Once finished, the tag should look like this:
    	<jsp-config development="true" />
    
  3. Add a timeout for the deployment scanner by setting deployment-timeout="240" as seen in the excerpt below:
    	<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
    		<deployment-scanner name="default"
                	path="deployments"
                	scan-enabled="true"
                	scan-interval="5000"
                	relative-to="jboss.server.base.dir"
                	deployment-timeout="240"/>
    	</subsystem>
    
  4. Add the following JAAS 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>
    
  5. Add the following system properties between the </extensions> and <management> tags:
    	<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>
    
  6. Save the changes.

If administrators plan to use IBM JDK, modify the $JBOSS_HOME/modules/com/liferay/portal/main/module.xml file and add <module name="ibm.jdk"> in the dependencies element. Next navigate to the $JBOSS_HOME/modules/system/layers/base/sun/jdk/main/module.xml file and insert the following path names inside the <paths>...</paths> element:

	<path name="com/sun/crypto" />
	<path name="com/sun/crypto/provider" />
	<path name="com/sun/image/codec/jpeg" />
	<path name="com/sun/org/apache/xml/internal/resolver" />
	<path name="com/sun/org/apache/xml/internal/resolver/tools" />

Otherwise, proceed to the next steps.

Administrators will need to configure the standalone.conf.bat file in Windows.

  1. Navigate to ${JBOSS_HOME}/bin.
  2. Open the standalone.conf.bat file.
  3. Enter: set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dsecmgr -Djava.security.policy=$JBOSS_HOME/bin/server.policy -Djboss.home.dir=$JBOSS_HOME -Duser.timezone=GMT -Xmx4096m -XX:MaxMetaspaceSize=2g"

For better performance, increase the -Xmx for 4g and MaxMetaspaceSize to 2g.

Security

Developers who want to use third party apps from Marketplace will want to protect the Liferay Digital Enterprise 7.0 instance and the JBoss server from security threats. To do so, enable Java Security on the JBoss server and specify a security policy to grant the Liferay Digital Enterprise 7.0 instance access to the server. Remember, set the -Dsecmgr and -Djava.security.policy Java options in the standalone.conf.bat file. The -Dsecmgr Java option enables security on JBoss. Likewise, the -Djava.security.policy Java option lists the permissions for the server's Java security policy. This configuration opens up all permissions. Tune the permissions in the policy later. Create the $JBOSS_HOME/bin/server.policy file and add the following contents:

grant {
    permission java.security.AllPermission;
};

For extensive information on Java SE Security Architecture, see its specification documents at JavaTM SE Platform Security Architecture. 

Deployment

  1. If the folder $JBOSS_HOME/standalone/deployments/ROOT.war already exists, delete all of its subfolders and files. Otherwise, create a new folder named $JBOSS_HOME/standalone/deployments/ROOT.war.
  2. Unzip the Liferay DXP 7.0 .war file into the ROOT.war folder.
  3. To trigger deployment of ROOT.war, create an empty file named ROOT.war.dodeploy in the $JBOSS_HOME/standalone/deployments/ folder. On startup, JBoss detects the presence of this file and deploys it as a web application.
  4. Start the JBoss application server by navigating to $JBOSS_HOME/bin and running standalone.bat|sh.

At this point, the application server has started and Liferay DXP 7.0 has been deployed. Deploy an activation key or manage the instance with Liferay Connected Services (LCS) to start using Liferay DXP.

Additional Information

Was this article helpful?
0 out of 0 found this helpful