Installing Alfresco Community 3.2 WAR on Centos 5.3

Document created by resplin Employee on Jun 6, 2015
Version 1Show Document
  • View in full screen mode

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:

Thanks goes to:

  1. Alfresco team for creating Alfresco and opensourcing the project; and
  2. the original group of wiki contributors, whom 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!!

Start with a new clean install of Centos 5, and make sure it is updated with yum:

user@localhost:~> sudo yum update

Install tomcat5, MySQL, and OpenOffice

Some packages may already be installed on your system, but proceeding with this section should not present a problem. It should skip already installed packages gracefully.

Install the required underlying packages with the following command:

user@localhost:~> sudo 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

Remove the openjdk and openjdk-devel packages with the following command:

user@localhost:~> sudo rpm -e java-1.6.0-openjdk java-1.6.0-openjdk-devel

Update your system again with the following command:

user@localhost:~> sudo yum update

Get all the main packages needed for installation

Make the working directory with the following command:

user@localhost:~> cd /opt

user@localhost:/opt> sudo mkdir alfresco

user@localhost:/opt> cd alfresco

Download the required main packages into the working directory with the following command:

user@localhost:/opt/alfresco> sudo wget \ \ \ \ \

Note that these last two packages are just an easy way to get the Sun Java package; as well as the MySQL connector required for MySQL database use. You may choose to download the appropriate packages from their respective sources. If so, navigate to the Sun and MySQL sites and do so.

Install JDK 1.6

Navigate to the Sun site and acquire the java binary package. To do so, proceed with
the following procedure:

  1. In your web browser of choice, navigate to the following url:
  2. Select Download for JDK 6 Update 6.
  3. Select Linux from the Platform drop down list.
  4. Select Agree to proceed.
  5. Select Continue.
  6. Proceed with downloading the file named: jdk-6u6-linux-i586-rpm.bin

Now, set the execution bit and proceed to execute the acquired java binary package with the following commands:

user@localhost:/opt/alfresco> sudo chmod +x jdk-6u6-linux-i586-rpm.bin
user@localhost:/opt/alfresco> sudo ./jdk-6u6-linux-i586-rpm.bin

You will be presented with a few questions. Answer accordingly. The binary package will install various java packages for you.

Install the compatibility package to ease use of your new installation of the sun java packages with the following command:

user@localhost:/opt/alfresco> sudo rpm –Uvh java-1.6.0-sun-compat-

You may receive the following error on stderr while attempting to install java-1.6.0-sun-compat:

error: Failed dependencies:
jdk = 2000:1.6.0_06-fcs is needed by java-1.6.0-sun-compat-

If so, navigate to the following url and acquire a different JDK version: Proceed to download this particular java binary package in the same manner as the procedure stated previously.

To make sure your system is configured to use this latest version of Java by default, run the command:

user@localhost:/opt/alfresco> sudo alternatives --config java

You should see that there are two or more java installations. The '+' character indicates the selected java installation for use in your system at this time.

   Selection    Command

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

Select the sun java installation by means of the appropriate numeric digit located at the left most extent of your terminal. If the sun java installation is already chosen, then simply press Enter.

To ensure that all the neccessary java packages have been successfully installed, proceed with the following command:

user@localhost:/opt/alfresco> sudo rpm -qa | grep java

You should be presented with output similiar to the following:


Configuring Tomcat

To configure proper usage of system memory, edit /etc/sysconfig/tomcat5 and add the following to the bottom of the file:

vi /etc/sysconfig/tomcat5

add the following to the bottom of the file:

JAVA_OPTS='$JAVA_OPTS -Xms512m -Xmx512m -XX:MaxPermSize=256M'

These values seem to work well on our system, which has 2 GB memory.

Unpack Alfresco Community WAR tarball

Un-tar that first WAR bundle tarball, but just leave the sample extensions tarball where it is for now. You will not need it until later.

[root@localhost alfresco]# tar -xzf alfresco-community-war-3.2.tar.gz

Creating the Alfresco MySQL database

[root@localhost alfresco]# chkconfig mysqld on

[root@localhost alfresco]# service mysqld start

Make the necessary changes to set your new MySQL admin password, then import the Alfesco database, included in the extras directory.

[root@localhost alfresco]# mysql -u root -p show databases; to make sure the new alfresco database is there.

[root@localhost alfresco]# mysql

mysql> show databases;

| Database           |
| information_schema |
| alfresco           |
| mysql              |
| test               |
4 rows in set (0.00 sec)

mysql> exit

Creating the Alfresco repository

[root@localhost alfresco]# mkdir -p /var/lib/alfresco/alf_data/

[root@localhost alfresco]# chown -R tomcat:tomcat /var/lib/alfresco

Note that is is important that you do the second step.


[root@localhost alfresco]# tar -xzf mysql-connector-java-5.1.5.tar.gz

[root@localhost alfresco]# cd mysql-connector-java-5.1.5

[root@localhost alfresco]# cp mysql-connector-java-5.1.5-bin.jar /usr/share/java/

[root@localhost alfresco]# cd /var/lib/tomcat5/common/endorsed/

[root@localhost alfresco]# rebuild-jar-repository /var/lib/tomcat5/common/endorsed mysql-connector-java-5.1.5-bin.jar

Installing Alfresco under Tomcat

Install the Alfresco .war file under Tomcat:

[root@localhost alfresco]# cd /opt/alfresco/

[root@localhost alfresco]# cp alfresco.war /var/lib/tomcat5/webapps

[root@localhost alfresco]# service tomcat5 start

Starting tomcat5:                                          [  OK  ]

[root@localhost alfresco]# service tomcat5 stop

Stopping tomcat5:                                          [  OK  ]

Extract Alfresco Extensions

At this point, un-tar the alfresco-community-sample-extensions-3.2.tar.gz into the appropriate Tomcat extensions directory:

[root@localhost alfresco]# cd /var/lib/tomcat5/shared/classes

[root@localhost classes]# tar -xzf /opt/alfresco/alfresco-community-sample-extensions-3.2.tar.gz

Modifying the basic Alfresco properties

Then rename the primary configuration sample files:

[root@localhost alfresco]# mv /var/lib/tomcat5/webapps/alfresco/WEB-INF/classes/
perties.sample /var/lib/tomcat5/webapps/alfresco/WEB-INF/classes/

edit the file


In the same file ( make sure you uncomment the following lines:


Copy file to tomcat share library directory

cp /var/lib/tomcat5/webapps/alfresco/WEB-INF/classes/  /var/lib/tomcat5/shared/classes/

Then, go back into your MySQL database and run the following command:

[root@localhost alfresco]# mysql

mysql> set password for 'alfresco'@'localhost' = PASSWORD('newpassword');  

Note that this is the password you just edited in

Quit out of MySQL:

mysql> exit

cd /var/lib/tomcat5/webapps/alfresco/WEB-INF/classes

Edit the file


Under ###### File appender definition ####### be sure to insert the line:


Start Tomcat

[root@localhost alfresco]# chkconfig tomcat5 on

[root@localhost alfresco]# service tomcat5 start

Firewall settings

In the Centos 5 GUI, you need to change the firewall settings to open TCP port 8080.

You can also do this by editing iptables from the command line, but using the GUI seemed to work better for some reason.

You may need to restart the system. I was doing some troubleshooting post-install, and everything worked fine after the restart. Correlation is not causation, and you should not have to restart the machine, but if the install is not working, you might want to try it.

You should now be able to see the Alfresco start page by navigating to:


Login: admin
Password:  admin

Add WCM Component

[root@localhost alfresco]# service tomcat5 stop

[root@localhost alfresco]# mkdir wcm

[root@localhost alfresco]# cd wcm

[root@localhost wcm]# tar -zxvf ../alfresco-community-wcm-3.2.tar.gz

[root@localhost wcm]#  cp wcm-bootstrap-context.xml /var/lib/tomcat5/shared/classes/alfresco/extension/

[root@localhost wcm]# service tomcat5 start