Liferay DXP is supported on tc Server. Please see the Compatibility Matrix for the supported version. Before proceeding, you must download these Additional Files:
- Liferay DXP WAR file
- Dependencies ZIP file
- OSGi Dependencies ZIP file
Once you have those pieces of the puzzle, you just need to assemble them.
Installing Liferay DXP manually requires these basic steps:
- Installing Liferay DXP dependencies to your application server
- Configuring your application server for Liferay DXP
- Installing Liferay DXP by providing the WAR file to your application server and the OSGi folder for Liferay DXP
Installing Liferay DXP Dependencies
Liferay DXP depends on some additional JARs that aren’t included with tc Server by default. There are even more JARs that you’d find in a Liferay DXP bundle that are not required but can be useful. If you don’t have a Liferay DXP bundle, you can download the required JARs from third parties, as described below.
Here are the JARs included in the dependencies zip file:
-
com.liferay.registry.api-1.0.4.jar -
hsql.jar -
portal-kernel.jar -
portlet.jar
One JAR you definitely need that is not included in the dependencies zip is your database driver. Database drivers for MySQL and PostgreSQL can be found in a Liferay DXP bundle or in the Liferay DXP source code.
There are several other dependency JARs that aren’t included in the dependencies zip. If you don’t have them already on hand or have access to a Liferay DXP bundle, you’ll have to download them yourself.
-
jta.jar: Support for Java transactions. You can get this.jar, which manages transactions, from http://www.oracle.com/technetwork/java/javaee/jta/index.html -
mail.jar: Support for the Java Mail API. You can get this.jarfrom http://www.oracle.com/technetwork/java/index-138643.html -
persistence.jar: Support for the Java Persistence API. You can get this.jarfrom http://www.oracle.com/technetwork/java/javaee/tech/persistence-jsp-140049.html -
activation.jar: This is an implementation of the Java Activation Framework. You can get this.jarfrom [http://www.oracle.com/technetwork/java/jaf11-139815.html](http://www.oracle.com /technetwork/java/jaf11-139815.html) -
ccpp.jar: Enables Composite Capability/Preference Profiles. You can get this.jarfrom http://mvnrepository.com/artifact/javax.ccpp/ccpp/1.0 -
jms.jar: The Java Messaging Service. You can get this.jarfrom http://www.oracle.com/technetwork/java/docs-136352.html -
jutf7.jar: Provides UTF-7 and Modified UTF-7 charsets for Java. You can get this.jarfrom http://sourceforge.net/projects/jutf7/ -
junit.jar: Lets you run unit tests. You can get this.jarfrom http://sourceforge.net/projects/junit/
Place these JARs in Liferay Home’s lib folder (not tc Server’s) (see more steps below).
Liferay DXP includes an OSGi runtime. Extract the OSGi ZIP file that you downloaded
and copy the osgi folder to your Liferay Home folder. The osgi folder
contains many required JAR files and a few configuration files.
Configuring tc Server
There are a few configuration edits to make so Liferay DXP runs well on tc Server. All of these configuration changes should be made in your tc Server runtime instance.
-
Download and unzip tc Server available here. This will be referred to as
[TCSERVER_INSTANCE_HOME]. -
Create a folder called
serversinside[TCSERVER_INSTANCE_HOME]. (e.g./opt/pivotal-tc-server-standard-3.1.8.release/servers). This folder becomes Liferay Home (see note above) and you should not confuse the two. -
Next, create an instance called dxp-server where Liferay DXP will be deployed. Run the command:
tcruntime-instance.bat|sh create -i servers dxp-server -
Copy the dependencies
jarsinside thelibfolder inside[TCSERVER_INSTANCE_HOME]/servers/dxp-server.
Checkpoint:
-
A new folder called
servershas been created. -
A new folder called
dxp-serverhas been created inside theserversfolder. The following folders have been created inside thedxp-serverfolder:
binconfliblogstempwebappswork
Liferay DXP dependencies have been placed inside the
[TCSERVER_INSTANCE_HOME]/servers/dxp-server/lib folder:
com.liferay.registry.api-1.0.4.jarhsql.jarportal-kernel.jarportlet.jarjta.jarjunit.jarjutf7.jarjms.jarmail.jarpersistence.jaractivation.jarccp.jar- a database jar for other than HSQL (e.g. mariadb, mysql, db2)
There are a few more configuration changes for Liferay DXP to run well on tc Server 3. All of these configuration changes should be made in the tc Server runtime instance.
-
Navigate to the
[TCSERVER_INSTANCE_HOME]/servers/dxp-server/binfolder. Insetenv.shreplace this lineJVM_OPTS="-Xmx512M -Xss256K"with this one
JVM_OPTS="-Dfile.encoding=UTF-8 -Duser.timezone=GMT -Xmx1024M -Xss512K -XX:MaxMetaspaceSize=512m"In
setenv.batreplaceset JVM_OPTS=-Xmx512M -Xss256Kwith
set JVM_OPTS=-Dfile.encoding=UTF-8 -Duser.timezone=GMT -Xmx1024M -Xss512K -XX:MaxMetaspaceSize=512m -
Next, you should make sure that UTF-8 URI encoding is used consistently. Open
[TCSERVER_INSTANCE_HOME]/servers/dxp-server/conf/server.xmland make sure theConnectortag includes setting theURIEncodingtoUTF-8.<Connector acceptCount="100" connectionTimeout="20000" executor="tomcatThreadPool" maxKeepAliveRequests="15" port="${bio.http.port}" protocol="org.apache.coyote.http11.Http11Protocol" redirectPort="${bio.https.port}" URIEncoding="UTF-8" /> -
If you’re installing Liferay DXP and tc Server on Windows, open
[TCSERVER_INSTANCE_HOME]/servers/dxp-server/conf/wrapper.confand replacewrapper.java.additional.8=-Xmx512Mwith
wrapper.java.additional.8="-Xmx1024M"and
wrapper.java.additional.9=-Xss256Kwith
wrapper.java.additional.9="-Xss512K" wrapper.java.additional.10="-XX:MaxMetaspaceSize=256M" wrapper.java.additional.11="-Dfile.encoding=UTF-8" -
Last, open
[TCSERVER_INSTANCE_HOME]/servers/dxp-server/conf/web.xmland add the following after<load-on-startup>3</load-on-startup><init-param> <param-name>compilerSourceVM</param-name> <param-value>1.8</param-value> </init-param> <init-param> <param-name>compilerTargetVM</param-name> <param-value>1.8</param-value> </init-param>
Database Configuration
The easiest way to handle your database configuration is to let Liferay DXP manage your data source. If you want to use Liferay DXP’s built-in data source, you can skip this section.
If you want tc Server to manage your data source, use this procedure:
-
Make sure your database server is installed and working. If it’s installed on a different machine, make sure it’s accessible from your Liferay DXP machine.
-
Add your data source as a resource in the context of your web application specified in
[TCSERVER_INSTANCE_HOME]/servers/dxp-server/conf/Catalina/localhost/ROOT.xml(create this file if you don’t have it already):<Resource name="jdbc/LiferayPool" auth="Container" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8" username="root" password="root" maxActive="100" maxIdle="30" maxWait="10000" />
Note that the above resource definition assumes your database name is lportal, that you’re using MySQL, and that your MySQL username and password are both root. You’ll have to update these values with your own database name and credentials.
Your data source is now configured. Next set up the mail session.
Mail Configuration
As with database configuration, the easiest way to handle mail configuration is to let Liferay DXP handle your mail session. If you want to use Liferay DXP’s built-in mail session, skip this section and use Liferay DXP’s Control Panel to configure a mail server after Liferay DXP has been installed and started.
To create a mail session bound to mail/MailSession, edit
[TCSERVER_INSTANCE_HOME]/servers/dxp-server/conf/Catalina/localhost/ROOT.xml
and configure your mail session in a Resource tag. Make sure to replace the
example mail session values with your own.
<Resource
name="mail/MailSession"
auth="Container"
type="javax.mail.Session"
mail.pop3.host="pop.gmail.com"
mail.pop3.port="110"
mail.smtp.host="smtp.gmail.com"
mail.smtp.port="465"
mail.smtp.user="user"
mail.smtp.password="password"
mail.smtp.auth="true"
mail.smtp.starttls.enable="true"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
mail.imap.host="imap.gmail.com"
mail.imap.port="993"
mail.transport.protocol="smtp"
mail.store.protocol="imap"
/>
Your mail session is configured. Next, you’ll make sure Liferay DXP can access your mail session and database.
Configuring a Database and Mail Session
In this section you’ll specify appropriate properties for Liferay DXP to use in connecting to your database and mail session.
-
If you are using tc Server to manage your data source, add the following line to the
portal-ext.propertiesfile in your Liferay Home.jdbc.default.jndi.name=jdbc/LiferayPool -
If you are using tc Server to manage your mail session, add the following to
portal-ext.properties:mail.session.jndi.name=mail/MailSession
Before you deploy Liferay DXP, you should configure a Portal Access Control List (PACL).
Enabling PACL
To enable PACL, you need to enable Tomcat’s security manager. Make sure
[TCSERVER_INSTANCE_HOME]/servers/dxp-server/conf/catalina.policy specifies the permissions
grant {
permission java.security.AllPermission;
};
Open [TCSERVER_INSTANCE_HOME]/servers/dxp-server/bin/setenv.sh if on Linux, Unix, or Mac OS, or
setenv.bat if on Windows. Enable the security manager by inserting the
following code into the CATALINA_OPTS variable (inside quotation marks):
-Djava.security.manager -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy
Now you have PACL enabled and configured for your portal.
Deploying Liferay DXP
Now you’re ready to deploy Liferay DXP using your Liferay DXP WAR file.
-
If you are manually installing Liferay DXP on a clean tc Server instance, delete the contents of the
[TCSERVER_INSTANCE_HOME]/servers/dxp-server/webapps/ROOTdirectory. This removes the default Tomcat home page. -
Extract the Liferay DXP
.warfile to[TCSERVER_INSTANCE_HOME]/servers/dxp-server/webapps/ROOT.Now it’s time to launch Liferay DXP!
-
Start tc Server by navigating to the runtime instance’s
binfolder and executing./tcruntime-ctl.sh runor/tcruntime-ctl.sh start. If you’re on Windows you can use the.batversion of the startup script only if you installed the tc Server instance as a Windows service. Alternatively, you can use./catalina.sh runorcatalina.bat run.
After you set up your account you can start using Liferay DXP.