Installing Alfresco Community WAR on Centos 5

Showing results for 
Search instead for 
Did you mean: 

Installing Alfresco Community WAR on Centos 5

0 0 3,598

Obsolete Pages{{Obsolete}}

The official documentation is at:


A few important words

This document borrows heavily from an excellent wiki post located at

My company was looking to install Alfresco on Linux, and the war package had proven to be our preferred method. We had originally considered using the Alfresco package offered by Red Hat Exchange, but the supported version is currently at version 2.0, which, as I understand it, does not include WCM (which we need).

So this is how we got Alfresco up and running on Centos 5, but these instructions should work for most rpm-based distributions.

Getting started

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

yum update

Install tomcat5, MySQL, and OpenOffice

(OpenOffice is probably already installed on your system, but running this command with the OpenOffice packages specified will not be an issue)

[root@localhost alfresco]# 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

Update with yum again:

yum update

Get all software needed for install

Ensure that you are root user.

[root@localhost ~]# cd /opt

[root@localhost opt]# mkdir alfresco

[root@localhost opt]# cd alfresco

[root@localhost alfresco]# wget \ \ \ \ \

Note that these last two files are just an easy way to get the SUN Java RPM and MySQL Connector. You may wish to look on the Sun and MySQL websites to find them.

Install JDK 1.6

The best way to install JDK1.6 is to login as root and run this in the shell.

[root@localhost alfresco]# yum install java-1.6.0-openjdk.i386

After this you should be able to have the jdk 1.6 installed.

If this does not work, then fallow the instructions at the button.

First we need to go to Sun and get the Java files:

Select Download for JDK 6 Update 6

Select Linux from the Platform drop down list.

Select Agree if you decide too.

Select Continue.

Download this file jdk-6u6-linux-i586-rpm.bin

[root@localhost alfresco]# chmod +x jdk-6u6-linux-i586-rpm.bin

[root@localhost alfresco]# ./jdk-6u6-linux-i586-rpm.bin

You will have to agree to a few things, but it self installs.

[root@localhost alfresco]# rpm –Uvh java-1.6.0-sun-compat-

You might get the error described below while trying to install java-1.6.0-sun-compat. If you do, get a different JDK version from here and select 'Download' for JDK 6 Update 6:

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

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

[root@localhost alfresco]# alternatives --config java

You should see that there are two programs that 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

If number 2 has the *+ next to it, you should be fine. There is no need to do anything, just press Enter. If, for some reason, 1 is selected, then type 2 and press Enter.

As a final Java configuration test, you can run:

[root@localhost alfresco]# rpm -qa | grep java

Check to see that java-1.6.0-sun-compat- is listed

[root@localhost alfresco]#rpm -qa | grep java

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'

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-2.1.0.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  ]

Modifying the basic Alfresco properties

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

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

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

Then rename the primary configuration sample files:

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

[root@localhost alfresco]# cp custom-repository-context.xml.sample custom-repository-context.xml

[root@localhost alfresco]# cp

[root@localhost alfresco]# cp

Make the following changes:

edit the file


paste dir.root=/var/lib/alfresco/alf_data under the line #dir.root=/srv/alfresco/data

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

db.password=alfresco (change this to your own custom password)

Edit the file and ensure the only line uncommented is this one:


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 alfresco]# tar -zxvf ../alfresco-community-wcm-2.1.0.tar.gz

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

[root@localhost alfresco]# service tomcat5 start