• 1.800.975.6814

@dailyrazor Blog


Liferay Hosting – How to Configure and Deploy Liferay on Virtual Hosting or Private Tomcat Server

Posted BY: Web Master | Comment: | Category:

liferay hosting

Liferay is an open source portal written in Java and distributed under the GNU Lesser General Public License[2] and proprietary licenses. It is primarily used to for intranets and extranets applications. It allows users to set up features common to websites and is fundamentally constructed of functional units called portlets. Liferay is sometimes described as a content management framework or a web application framework. Its support for plugins extends into multiple programming languages, including support for PHP and Ruby portlets.

Although Liferay offers a sophisticated programming interface for developers, no programming skills are required for basic website installation and administration.
Since it is Java based, Liferay runs on any computing platform capable of running the Java Runtime Environment and an application server. Liferay is bundled with a Apache Tomcat servlet container.

DailyRazor is a leading java hosting provider for Liferay hosting. Liferay is supported and can be hosted on any of our Java VPS hosting or Private Java Tomcat hosting plans. Although theoretically, Liferay can be hosted on our Private Tomcat Hosting plans which runs on a shared environment, we strongly recommend hosting Liferay on a Java VPS hosting environment (if your budget permits of course :)) for maximum application performance.


>View our Java VPS hosting plans that support Liferay Hosting

>View our Private Tomcat hosting plans that support Liferay


How to Deploy Liferay on DailyRazor Servers:



  • Java 5 or greater
  • Tomcat or JBoss

Steps for Private Tomcat plan owners:

  • 1. Open LifeRay portal download page – additional-files section – http://www.liferay.com/downloads/liferay-portal/additional-files and download the unbundled Liferay web application (WAR file) – liferay-portal-.zip and liferay portal dependencies – liferay-portal-dependencies-.zip
  • 2. Rename liferay-portal-.zip to liferay-portal.war, unpack liferay-portal-dependencies-.zip file.
  • 3. Upload all jar libraries under the folder where liferay-portal-dependencies-.zip archive was unpacked to, to Tomcat’s shared lib folder – /home/_username_/tomcat/shared/lib/ (where _username_ is name of your account on the server).
  • 4. Make sure you don’t have an application listening at the root (/) of your server. If you do, move it to a different context or undeploy it.
  • 5. Make sure the JDBC driver for your database is accessible by Tomcat. Obtain the JDBC driver for your version of the database server. In the case of MySQL, use mysql-connector-java-{$version}-bin.jar. You can download the latest MySQL JDBC driver from http://www.mysql.com/products/connector/. Extract the JAR file and copy it to $TOMCAT_HOME/lib/ext.
  • 6. Liferay requires an additional .jar on Tomcat installations to manage transactions. This is included in the bundle but you need to add it if you’re installing Liferay manually. You may find this .jar here: http://www.oracle.com/technetwork/java/javaee/jta/index.html. Place this file in Tomcat’s lib/ext folder.
  • 7. Restart your application server, deploy the liferay-portal.war file uplate deployed app configuration (described below) and start it.


liferay hosting

Steps for Shared Tomcat plan owners:
Shared tomcat owners can’t deploy Liferay due to shared tomcat limitations and should proceed with account upgrade to one of plans with private tomcat support.

Configuring LifeRay:

    • 1. Database Configuration

If you want Tomcat to manage your data source, use the following procedure. If you want to use Liferay’s built-in data source, you can skip this section.
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 machine.
Add your data source as a resource in the context of your web application specified in $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml.

<Context…> <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″ /> </Context>

Note the above resource definition assumes your database name is lportal and your MySQL username and password are both root. You’ll have to update these values with your own database name and credentials.

    • 2. Mail Configuration

If you want to manage your mail session within Tomcat, use the following instructions. If you want to use the built-in Liferay mail session, you can skip this section.
Create a mail session bound to mail/MailSession. Edit $TOMCAT_ HOME/conf/Catalina/localhost/ROOT.xml and configure a mail
session. Be sure to replace the mail session values with your own.

<Context…> <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” /> </Context>

    • 3. Configuring your database and mail session

(a) If you are using Tomcat to manage your data source, add the following to your portal-ext.properties file in your Liferay Home to refer to your data source:


Otherwise, if you are using Liferay Portal to manage your data source, follow the instructions in the Deploy Liferay section for using the setup wizard.

(b) If want to use Liferay Portal to manage your mail session, you can configure the mail session within Liferay Portal. That is, after starting your portal as described in the Deploy Liferay section, go to Control Panel -> Server Administration -> Mail and enter the settings for your mail session.

Otherwise, if you are using Tomcat to manage your mail session, add the following to your portal-ext.properties file to reference that mail session:


Official documentation: http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/