Flexible Liferay 7 - Tomcat Setup

Flexible Liferay 7 - Tomcat Setup

The challenge

If you want to run Liferay 7 on Tomcat using the bundle provided by Liferay or packages provided in your Linux distribution are convenient ways to get Liferay up and running fast.

In many cases you may however want to have a better control on which Tomcat version you are running on and also want to have an easy upgrade path. You may also want to run multiple Tomcat instances in one server like one for Liferay and one for SOLR and want to reduce administrative tasks and avoid installing Tomcat multiple times. If you are a developer you could also want to run different versions of the portal and even run the portal on different JREs in the same server. It would also be convenient to be able to setup database easily for the Tomcat instances.

Last but not least the setup created by the scripts provided here shouldn’t be anything proprietary or dependent of the scripts.

About this setup

To fulfill these requirement this setup aims at the following objectives:

  • Automation scripts provided here should be readable and easily modifiable
  • Installation structure should be simple and readable
  • Tomcat installation folder should remain unmodified if possible
  • Invidual Tomcat instances should be easily configurable
  • There should be a fast way to create new Tomcat instances from templates
  • Database creation and configuration for a new Tomcat Liferay instance should be easy

By default this setup creates following structure:

There are three scripts in this package:

  • install-environment.sh: creates Tomcat environment, sets up MySQL and Java
  • create-liferay-instance.sh: creates a new Tomcat instance based on defined template
  • manage-instance.sh: starts and stops instances

This setup has been tested in Ubuntu Linux 16.04 LTS.

Yes, the setup and scripts here are not a Swiss knife solution as they are for example relying on MySQL. Hopefully someone will find them useful anyways!

The scripts and more instructions: https://github.com/peerkar/multi-instanced-tomcat-liferay-setup