Deploy Alfresco Share on Tomcat 6

As I could not find a complete tutorial on how to deploy Afresco Share on an existing Apache Tomcat version 6 I’ll now summarize all steps required.

Prerequisites

Before following the next steps make sure you have

  1. Java 1.5 or Java 1.6
  2. Apache Tomcat 6.x
  3. MySQL 5.x

installed.

Step 1: Get Alfresco Community Edition

Download the file archive alfresco-community-war-3.2.tar.gz and unpack the archive. It contains the alfresco.war and share.war web applications that you’ll need to get Alfresco Share up and running.

Step 2: Create database and database user

On Mac OS/Linux open a shell, on Windows open the command line. Log on to MySQL with the root user:

> mysql -u root -p

Next, create the database and a user for Alfresco and grant the according rights to the database user:

mysql> create database alfresco default character set utf8;
mysql> create user alfresco identified by 'alfresco';
mysql> grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
mysql> grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;

Step 3: Prepare Apache Tomcat

Make sure that your Tomcat installation disposes of the directories <TOMCAT_HOME>/shared/classes and <TOMCAT_HOME>/shared/lib. Tomcat 6 does not get distributed with these directories by default. If they are missing, please create them. Next, open the file <TOMCAT_HOME>/conf/catalina.properties and change the value of shared.loader= to:

shared.loader=${catalina.home}/shared/classes,${catalina.home}/shared/lib/*.jar

That way, Tomcat loads for all web applications any classes/property files and libraries that are located in these directories.

Alfresco does not get shipped with a JDBC driver for MySQL. You can download the current driver from http://dev.mysql.com/downloads/connector/j/5.1.html. Unpack the archive and copy the driver mysql-connector-java-5.1.12-bin.jar (at the time of writing this post this driver was the current one) to <TOMCAT_HOME>/shared/lib.

Copy from your dowloaded unpacked alfresco-community-war-3.2.tar.gz archive the file <ALFRESCO_ARCHIVE>/extensions/extension/alfresco-global.properties to <TOMCAT_HOME>/shared/classes. Open the file alfresco-global.properties and change the value of db.driver= to (line 29):

db.driver=com.mysql.jdbc.Driver

Before we can start deploying Alfresco, make sure your Tomcat installation has a configured heap size of at least 256 MB. By default, Tomcat is started with the default heap size of your JVM. Usually, with these default settings the deployment of Alfresco will fail.

To increase Tomcat’s heap size on a Unix/Linux system open the file <TOMCAT_HOME>/bin/startup.sh and add following line at the beginning of the file:

export CATALINA_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=196m"

On Windows based systems open the file <TOMCAT_HOME>/bin/startup.cmd and add the following line at the beginning of the file:

set CATALINA_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=196m"

In case Tomcat was running you have to restart it in order the heap size changes take effect.

Step 4: Deploy Alfresco web applications

Start Tomcat by executing the start script <TOMCAT_HOME/bin/startup.sh (Unix/Linux systems) or <TOMCAT_HOME/bin/startup.cmd (Windows systems).

Simply copy the file <ALFRESCO_ARCHIVE>/alfresco.war to <TOMCAT_HOME>/webapps. As long as you have not changed Tomcat’s default deploy settings, Tomcat will deploy the web archive automatically. Have a look at Tomcat’s logfile located at <TOMCAT_HOME>/logs/catalina.out. At the end of the log file there should be an entry similar to

18:52:46,528 User:System INFO  [service.descriptor.DescriptorService] Alfresco started (Community): Current version 3.2.0 (2039) schema 2019 - Installed version 3.2.0 (2039) schema 2019

Next, copy the file <ALFRESCO_ARCHIVE>/share.war to <TOMCAT_HOME>/webapps. At the end of the Tomcat’s log file you should see an entry like

23:56:58,258  INFO  [web.site.FrameworkHelper] Successfully Initialized Web Framework

Well done, we are finished. Let’s open Alfresco Share in your favorite browser. Therefore, type http://localhost:8080/share in the address bar. You should the see the following screen:

Alfresco login

Login with username admin and password admin.
The document http://wiki.alfresco.com/w/images/d/de/Getting_Started_with_Share_for_Alfresco_Community_Edition_3_2.pdf will help you to get acquainted with Alfresco Share. Have fun!

This entry was posted in Dev and tagged , , . Bookmark the permalink.

3 Responses to Deploy Alfresco Share on Tomcat 6

  1. Javier says:

    Thanks, was much clearer than the wiki. The 4.0 version is almost the same.
    It was running in almost no time. 🙂
    Javier
    Mexico

  2. Very good tutorial, helped me a lot even in 3.4.d
    Thanks!

  3. Pingback: Alfresco development at Computational Linguistics

Comments are closed.