Installation Tips for a Jahia Setup on Linux OS

Apr 26, 2012
Daniel Ovalle

Jahia Tips ChecklistJahia is an open source web content integration software that combines enterprise web content management with document management and portal features1. The Jahia setup on a Linux (Debian GNU/Linux) server is simple.

To start, read the Jahia xCM community documentation as a first step to start testing your own CMS instance as a developer. The documentation has important tips and recommendations for developers and administrators to ensure the setup of your CMS instance will be quick and easy.

For Jahia beginners,the community documentation and the Wiki (Jahiapedia) content available on the Jahia website will be really helpful. Your first project creation, the introduction to basic concepts of the CMS, and the templates creation guidance will help you quickly start your first web content project with this CMS.

The scope of this post is to show you the setup of the Jahia xCM on a Linux host using the command line mode of the installer. I’ll also go over how to check the basic configuration parameters and files that should be in place to start working with Jahia xCM V6.6.0.0.

To start with the installation, we need to check the following system requirements:

JDK (Java development kit) and Tomcat6 (Apache Servlet Container)

The Jahia xCM is a web application built over the Java Servlet Specification 2.4. This means it could be deployed on a JDK 1.5 and a servlet container that implements this specification like Tomcat 5.5.X; however, following project recommendations we will use JDK 6 and Tomcat6 for this setup.

Install Java Development Kit v6 using the apt package manager:

apt-get install openjdk-6-jdk

The apt will set all environment variables (JAVA_HOME, PATH) and the Java commands will be available and detectable by the Java applications on this host. On the terminal, you can check the installation by typing in "java -version" and you should see this command:

java -version

 

java version "1.6.0_18"

OpenJDK Runtime Environment (IcedTea6 1.8.10) (6b18-1.8.10-0+squeeze2)

OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

Now we can install the Tomcat6 servlet container using the apt tool:

apt-get install tomcat6

Again, the apt will take care of the entire setup and default installation (environment variables and system V init scripts) for the servlet container as an OS service.

That's all, Now our Linux OS is ready for deployment.

Jahia xCM Installation

The Jahia community installer is available for Linux/OSX on the community downloads page as well as install instructions for the Java graphical installer. To get the installer, use wget/curl tools to get the distributed jar file:

wget --no-check-certificate https://www.jahia.com/public/jahia-6.6.0/bin/Jahia_xCM_v6.6.0.0_r40429.jar

To start the installer on the terminal type, use:

java -jar Jahia_xCM_v6.6.0.0_r40429.jar

This will start the installer on command line and you will see all the steps described on the graphical installer. On command line format, then you can follow the same steps. The difference here is that we want to deploy Jahia as a web application on our previously installed Tomcat6 and avoid using the bundled Tomcat that comes with the default installation.

To proceed with the command line installation, follow these steps:

Welcome to the installation of Jahia xCM 6.6.0.0!

 - Jahia Solutions Group SA <info@jahia.com>

The homepage is at: http://www.jahia.com

[license information]

Select target path => usr/local/Jahia_xCM_v6.6.0.0

Here you can choose your preferred installation type => Custom install (advanced)

Select the installation type you want to perform: => Deselect Add Apache Tomcat

Choose your preferred database connection type => Use a standalone DBMS

Choose your DBMS type => MySQL 5.x

Database driver => com.mysql.jdbc.Driver

Database URL => jdbc:mysql://localhost/jahia?useUnicode=true&characterEncoding=UTF-8&useServerPrepStmts=false

Database username => jahia

Database password => jahia

Store binary data in the database? => No

Create required database tables? => Yes

Context name (context path without /) => jahia

Jahia tool manager username => jahia

Jahia tool manager password => jahia

Use development mode for templates? => Yes

Username: => root

Password: => jahia

Externalize configuration => No 

[ Processing package: Jahia xCM + Jahia Composite Content Platform (1/1) ]

[ Unpacking finished ]

Install was successful

application installed on /usr/local/Jahia_xCM_v6.6.0.0

[ Console installation done ]

After the installation procedure is complete you can check the WAR file we need on the installation dir (/usr/local/Jahia_xCM_v6.6.0.0) named "jahia.war". This file is now a standard Java web application and we can proceed with the configuration for deployment on our Tomcat6 servlet container.

I followed the recommendation to use a web application directory outside the default Tomcat6 directories structure. This helps a lot on maintenance operations and simplifies Tomcat upgrades and/or Jahia upgrades. To do this, I'll unzip the jahia.war file in the "jahia_war" directory in the installation directory: 

jahia_war

 |---admin

 |---css

 |---engines

 |---errors

 |---favicon.ico

 |---gwt

 |---html

 |---icons

 |---iphone

 |---jahia.war

 |---javascript

 |---LICENSE

 |---META-INF

 |---modules

 |---ping.jsp

 |---tools

 |---WEB-INF

This is the web application content and in this structure, we can do all the modifications for the Jahia xCM setup we need. Now we need a deployment file for the Jahia web application.

During the installation process, we selected a web context different than "/" for the Jahia web application: "/jahia". This means that for our deployment, the file will be named "jahia.xml" and will be located into the $TOMCAT_HOME/var/lib/tomcat6/conf/Catalina/localhost/ directory. By default, this is the location of the deployment descriptors in Tomcat.

The content in this file should be:

<Context path="/jahia" docBase="$jahia_war_path" antiResourceLocking="false" crossContext="true" >

<Manager pathname="" />

<Resource

name="jdbc/jahia"

auth="Container"

factory="org.apache.commons.dbcp.BasicDataSourceFactory"

type="javax.sql.DataSource"

username="jahia"

password="jahia"

driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://localhost/jahia_6_6_0_0?useUnicode=true&amp;characterEncoding=UTF-8&amp;useServerPrepStmts=false"

defaultAutoCommit="true"

accessToUnderlyingConnectionAllowed="true"

maxActive="200"

maxIdle="30"

maxWait="10000"

initialSize="5"

validationQuery="/* ping */"

testWhileIdle="true"

testOnBorrow="false"

testOnReturn="false"

timeBetweenEvictionRunsMillis="300000"

minEvictableIdleTimeMillis="1800000"

numTestsPerEvictionRun="5" />

</Context>

This file can be created using the jahia_war/META-INF/context.xml file and modifying the "Context" tag.

Once you put this file into the Tomcat-specified location, you can restart the Tomcat service and the Jahia web application will start:

service tomcat6 restart

Now you can check your Tomcat6 LOG (/var/log/tomcat6/catalina.out) and see all the Jahia web application startup information. This file becomes especially important to a developer’s work as this contains all the deployment and execution information.

Now we can point our browser to http://localhost:8080/jahia and we should see the start configuration page.

About the Installer

The Jahia xCM 6.6 has been recently released, and I tried some installations before writing this post. On those tests I noticed some fails on the installer (in graphic mode). If this happens to you, I suggest you check the following on your recently installed environment:

  • The file $JAHIA_WAR/WEB-INF/etc/jahia.properties was sometimes missing.
  • The file $JAHIA_WAR/WEB-INF/etc/log4j.xml defines the location of the Jahia LOG files (jahia.log, jahia_profiler.log, jahia_access.log), search the file definitions into the "appender" tags and add the location you want for those files, in my case I want all log file under "/var/log/tomcat6/" directory:

<appender name="ROLL" class="org.apache.log4j.DailyRollingFileAppender">

<param name="File" value="/var/log/tomcat6/jahia.log"/>...

  • On the $JAHIA_WAR/WEB-INF/etc/jahia.properties there used to be the DB configuration parameters, but on this release you will find this comment:

######################################################################
### Database ########################################################
######################################################################
# Database connection configuration is no longer configured here,
# but rather through container-managed datasource connection. In Tomcat
# these can be found in the following file:
# <jahia-web-app-dir>/META-INF/context.xml

I tried moving all the DB configuration parameters to this file from the "jahia.xml" but had no luck, so it seems you need to use the jahia.xml to define DB attributes.

If all goes well, this host will work fine as an integration environment and by following the documentation about the performance tuning provided on Jahia website, this can be used as a start point for a production instance.

Resources

1 www.jahia.com