Installing Alfresco Community 3.2r2 WAR on Centos 5.4

Showing results for 
Search instead for 
Did you mean: 

Installing Alfresco Community 3.2r2 WAR on Centos 5.4

0 0 1,220

Obsolete Pages{{Obsolete}}

The official documentation is at:


A few important words

This document borrows heavily from an excellent wiki post located at the following url:

which was based on:

I had difficulty installing the GUI way on Centos described in the Alfresco docs. After hitting bugs and checking the forums for solutions (which I found, awesome forums!) I decided to thy the 'longer' way. Maybe Centos 5.4 is too new for the install and docs. If you use this article I wish you the best of luck. If you find mistakes or updates, please take a few minutes to register (quick and easy) and update this doc please. Alfresco has gone through the trouble of giving this awesome software away, the least we can do it help support it. BTW, this doc as I'm writing it is current as of 2010.03.27.

The point of this Article is to update it based on the latest release of Alfresco which at this time is 3.2r2 and link to any new rpms. For example, there is now an rpm for swftools 0.9.0 so there isn't a need to built it. This eliminates the need for the gcc compile tools. Fewer steps; quicker install. I've also eliminated the [root@server ~]# in front of the commands so you can copy/paste to command line.

Thanks goes to:

  1. Alfresco team for creating Alfresco and opensourcing the project -- YOU ROCK!!
  2. the original group of wiki contributors, who made this revision possible.

Getting started

Caution! The following instructions require root access. Please be
cognizant that you could negatively affect your system due to inadvertent
commands. Mind what you type!!

Documentation Approach

This documents presents the actual steps which were necessary to install Alfresco Comunity 3.2r2 war on a freshly installed CentOS 5.4 i386 server installation. The CentOS 5.4 installation was completed onsite through a GUI install. Only major changes were using a Static IP, turning off firewall and SELinux. Unlike the wiki page this article is heavily based on, Alfresco is being installed on a Centos 5.4 32-bit system with default GUI (XWindows). However, everything will be done via command line as was done in the previous article.

The following is the plain commands entered, some relevant output presented by those and required input by the user. When file edits are necessary only the respective lines are shown with the required text. Sometimes existing lines have to be replaced by the text presented here. Some times new lines have to be added. To give reference to the location of the new lines one line before has been included in the text here.

Commands are enclosed in a the mediawiki code tags so you can copy many lines at once to paste in the command line. It looks like this:

yum update

Keyboard input is indicated by


Long lines are wrapped by a backslash


Text ommited, e.g. from files or output is indicated by


Interactive application prompts, e.g. mysql, are indicated by


Comments for further actions or reviews are indicated by

# Do this or that...

Installation Steps

Remove packages we won't need, it shouldn't hurt to leave it, but just in case.

rpm -e --nodeps java-1.6.0-openjdk java-1.6.0-openjdk-devel 

Install DAG repository:

To find the current rpmforge install go to the main page:

Otherwise this is what was used:

rpm -Uhv 

Update your system and get the latest package list:

yum update

Install prerequisites (Tomcat, OpenOffice, MySQL, ImageMagik)

yum install tomcat5 tomcat5-common-lib tomcat5-jasper tomcat5-jsp-2.0-api tomcat5-server-lib tomcat5-servlet-2.4-api mysql-server mysql xml-commons-apis wget ImageMagick

mkdir /opt/alfresco
cd /opt/alfresco

wget \ \ \ \ \ \ \ \ \ \ \ \ \

wget \ \ \ \ \ \ \ \ \ \



Sun Java JDK - Download and Install

No direct link allowed, so you must click through a few screens to download:

Once you download, install it:

chmod +x jdk-6u20-linux-i586-rpm.bin

Answer the few questions, done.

Sun Java JDK - Setup

Add the JDK to the alternatives so it can be setup as the default:

alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_20/bin/java 100
alternatives --install /usr/bin/jar jar /usr/java/jdk1.6.0_20/bin/jar 100
alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_20/bin/javac 100

Set Sun Java JDK as the default java (there can be only one!):

/usr/sbin/alternatives --config java
/usr/sbin/alternatives --config jar
/usr/sbin/alternatives --config javac

For each of the alternatives it'll ask you to pick a number for the default, choose the /usr/java/jdk... just like it was just installed.

Note: for the alternatives command, you have to paste one at a time or separate with a semicolon.

[root@server alfresco]# mkdir -p /usr/src/redhat/SOURCES

[root@server alfresco]# rpm -ivh java-1.6.0-sun-compat-
warning: java-1.6.0-sun-compat- Header V3 DSA signature: NOKEY, key ID c431416d
    1:java-1.6.0-sun-compat  warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
########################################### [100%]

[root@server alfresco]# cd /usr/src/redhat/SPECS/
[root@server SPECS]# vi java-1.6.0-sun-compat.spec

%define buildver        20
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/cacerts
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/blacklist
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/javaws.policy
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/trusted.libraries

[root@server SPECS]# rpmbuild -bb java-1.6.0-sun-compat.spec
[root@server SPECS]# rpm -Uvh /usr/src/redhat/RPMS/x86_64/java-1.6.0-sun-compat-
[root@server SPECS]# java -version
java version '1.6.0_20'
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

[root@server SPECS]# alternatives --config java

There are 2 programs which provide 'java'.

   Selection    Command
    1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2           /usr/lib/jvm/jre-1.6.0-sun/bin/java

Enter to keep the current selection[+], or type selection number:<enter>

[root@server SPECS]# cd ~/alfresco
[root@server alfresco]# vi /etc/sysconfig/tomcat5
# If you wish to further customize your tomcat environment,
# put your own definitions here
# (i.e. LD_LIBRARY_PATH for some jdbc drivers)
# Just do not forget to export them :)

JAVA_OPTS='$JAVA_OPTS -Xms1g -Xmx512m -XX:MaxPermSize=512M'

[root@server alfresco]# mkdir base
[root@server alfresco]# cd base
[root@server base]# tar xzf ../alfresco-community-war-3.2r.tar.gz
[root@server base]# chkconfig mysqld on
[root@server base]# service mysqld start
[root@server base]# mysql -u root -p