Another Stranger Me

my comments, my projects, my resources…

Alfresco 3.3g installation on CentOS 5.5 64-bit Linux server

The following guide will show you how to install a CentOS 5.5 64-bit Linux server based Alfresco ECM server. CentOS Linux distribution is amongst the most popular ones for its well known binary compatibility with major commercial Linux distribution Red Hat Enterprise Linux. CentOS is pretty much same as RHEL only without Red Hat’s vendor branding and artwork. Major reasons why you want to use CentOS over some other free Linux distributions is its stability and what’s most important hardware compatibility. Big hardware vendors like HP, Dell, or IBM tend to release Linux drivers for specific distributions only so choosing a distribution that is fully compatible with the USA-based and leading Linux vendor Red Hat is likely a smart move.

Now, important point to say is that Alfresco loves 64-bits so you want to install it on 64-bit hardware, operating system and use 64-bit Java Virtual Machine. While it certainly can work on 32-bit systems for production use I recommend that you use 64-bit system. Lets begin with Alfresco prerequisites.

Alfresco prerequisites

This article assumes you’ve got the base CentOS installation already completed as we focus on Alfresco not CentOS. So, you need just some base tools without GUI.

We begin my installing MySQL:

yum install mysql-server
/usr/bin/mysql_secure_installation

I won’t go into much detail regarding MySQL configuration but as a minimum I always configure the following properties in /etc/my.cnf to support utf8 and also avoid problems with table names capitalization:

character-set-server = utf8
collation-server = utf8_bin
lower_case_table_names = 1

Restart MySQL:

service mysqld restart

Next, we download and install Sun JDK 6 (make sure you use the RPM version):

chmod +x jdk-6u20-linux-x64.rpm.bin
./jdk-6u20-linux-x64.rpm.bin

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

Make sure you make the JDK 6 as default:

alternatives –config java
alternatives –config jar
alternatives –config javac

With CentOS 5 by default comes Tomcat 5.5 while Alfresco recommends Tomcat 6 so lets install it:

cd /etc/yum.repos.d
wget ‘http://www.jpackage.org/jpackage50.repo’
yum update
yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps

Unfortunately error message like this could appear:

java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64 from installed has depsolving problems
–> Missing Dependency: /usr/bin/rebuild-security-providers is needed by package java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64 (installed)
Error: Missing Dependency: /usr/bin/rebuild-security-providers is needed by package java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64 (installed)

Fix for this can be found here or you can just do the following:

rpm -Uvh http://plone.lucidsolutions.co.nz/linux/centos/images/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm

Repeat installation if necessary.

You can try accessing Tomcat by:

service tomcat6 start

Open http://centos-hostname:8080 in browser (adjust Firewall properties in CentOS if necessary).

When you verify Tomcat is running and that you can access it, stop it:

service tomcat6 stop

Let’s do a bit more Tomcat configuration:

cd /usr/share/tomcat6
mkdir -p shared/classes/alfresco

nano conf/catalina.properties
>> shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar

nano conf/tomcat6.conf
>> JAVA_OPTS=”$JAVA_OPTS -Xms128m -Xmx512m -XX:MaxPermSize=128M”

nano shared/classes/alfresco-global.properties
>>
#
# Sample custom content and index data location
#
dir.root=/var/lib/alfresco/alf_data
dir.indexes=/var/lib/alfresco/lucene

#
# Sample database connection properties
#
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.host=localhost
db.port=3306

#
# MySQL connection
#
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://${db.host}:${db.port}/${db.name}
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect

#
# Outbound Email Configuration
#
mail.host=localhost
mail.port=25
mail.encoding=UTF-8
mail.from.default=alfresco@somedomain.com
#mail.username=
#mail.password=
#mail.smtp.auth=true

#
# External locations
#
#ooo.exe=/usr/lib64/openoffice.org/program/soffice.bin
#img.root=./ImageMagick
img.dyn=/usr/lib64
img.exe=/usr/bin/convert
swf.exe=/usr/local/bin/pdf2swf

#
# CIFS configuration
#
cifs.enabled=true
cifs.serverName=centos-hostname
cifs.hostannounce=true
cifs.urlfile.prefix=http://centos-hostname:8080/alfresco

#
# FTP configuration
#
ftp.enabled=true
ftp.port=8021

Download MySQL JDBC connector to /lib:

pushd ~
wget http://gd.tuwien.ac.at/db/mysql/Downloads/Connector-J/mysql-connector-java-5.1.13.tar.gz
tar xzf mysql-connector-java-5.1.13.tar.gz
cp mysql-connector-java-5.1.13/mysql-connector-java-5.1.13-bin.jar /usr/share/tomcat6/lib/

Let’s move on to Alfresco… Download WAR package and install it:

wget http://dl.alfresco.com/release/community/build-2860/alfresco-community-war-3.3g.tar.gz
tar xzf alfresco-community-war-3.3g.tar.gz
unzip alfresco.war -d /usr/share/tomcat6/webapps/alfresco
unzip share.war -d /usr/share/tomcat6/webapps/share
cp -r endorsed /usr/java/jdk1.6.0_20/jre/lib/
cp -r extensions/* /usr/share/tomcat6/shared/classes/alfresco/
mysql -u root -p < extras/databases/mysql/db_setup.sql popd mkdir -p /var/lib/alfresco/alf_data mkdir -p /var/lib/alfresco/lucene chown -R tomcat:tomcat /var/lib/alfresco nano /usr/share/tomcat6/webapps/WEB-INF/classes/log4j.properties >> log4j.appender.File.File=/var/log/tomcat6/alfresco.log
nano /usr/share/tomcat6/webapps/share/WEB-INF/classes/log4j.properties
>> log4j.appender.File.File=/var/log/tomcat6/alfresco.log

Alfresco should work now so lets start it up and watch the Tomcat log for errors:

service tomcat6 start
tail -f /var/log/tomcat6/catalina.out

Open http://centos-hostname:8080/alfresco and http://centos-hostname:8080/share in browser and login in both with default administrator account username: admin and password: admin.

Everything OK? Shutdown Tomcat again:

service tomcat6 stop

We have only a couple of things left to install so that we get full functionality. This includes ImageMagick, OpenOffice, and SWF Tools. Lets start with ImageMagick:

yum install ImageMagick

We will need to compile SWF Tools so we’ll install required files first by:

yum install zlib-devel libjpeg-devel giflib-devel freetype-devel gcc gcc-c++
wget http://www.swftools.org/swftools-0.9.1.tar.gz
tar xzf swftools-0.9.1.tar.gz
cd swftools-0.9.1
./configure
make
make install

Finally, install OpenOffice:

yum install openoffice.org-base openoffice.org-calc openoffice.org-core openoffice.org-draw openoffice.org-graphicfilter openoffice.org-impress openoffice.org-math openoffice.org-writer openoffice.org-xsltfilter openoffice.org-headless

Unfortunately error message like this could appear:

java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64 from installed has depsolving problems
–> Missing Dependency: /usr/bin/rebuild-security-providers is needed by package java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64 (installed)
Error: Missing Dependency: /usr/bin/rebuild-security-providers is needed by package java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64 (installed)

Fix for this can be found here or you can just do the following:

rpm -Uvh http://plone.lucidsolutions.co.nz/linux/centos/images/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm

Repeat OpenOffice installation, it should work now:

yum install openoffice.org-base openoffice.org-calc openoffice.org-core openoffice.org-draw openoffice.org-graphicfilter openoffice.org-impress openoffice.org-math openoffice.org-writer openoffice.org-xsltfilter openoffice.org-headless

Lets create the init script so that we can run OpenOffice when system boots:

nano /etc/init.d/soffice

#!/bin/bash
# chkconfig: 345 20 80
# description: init.d script for headless openoffice.org (2.3+ for RHEL5 32bit)
# credit: Chris Schuld http://chrisschuld.com/2008/10/rhel5-init-initd-script-for-openoffice-org/
#
# processname: soffice
#
# source function library
. /etc/rc.d/init.d/functions

RETVAL=0
SOFFICE_PATH=’/usr/lib64/openoffice.org3/program’
SOFFICE_ARGS=’-accept=socket,host=localhost,port=8100;urp -headless -nofirststartwizard’
SOFFICE_PIDFILE=/var/run/soffice.bin.pid

start_soffice() {
echo -n $”Starting OpenOffice.org”
$SOFFICE_PATH/soffice.bin $SOFFICE_ARGS >/dev/null 2>&1 &
[ $? -eq 0 ] && echo_success || echo_failure
pidof soffice.bin > $SOFFICE_PIDFILE
echo
}
start() {
start_soffice
}
stop() {
echo -n $”Stopping OpenOffice”
killproc soffice.bin
echo
}
case “$1″ in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $”Usage: $0 {start|stop|restart}”
esac

chmod +x /etc/init.d/soffice
chkconfig tomcat6 on
chkconfig soffice on
service soffice start
service tomcat6 start

You can verify the new work done by creating a site in share, uploading a Microsoft Office document and previewing it. If you can see its preview then all required transformations are working.

This concludes the installation of Alfresco 3.3g on CentOS 5.5 64-bit and I hope you can find it helpful. If so, please let me know in comments.

18 Comments

  1. Hi Ivan,

    Thanks for the nice article on the topic.

    BTW, there seems to be a following bug with LDAP-AD for the current version of 3.3g though it long appeared in 3.2.

    http://issues.alfresco.com/jira/browse/ALF-2796?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel

    Are you aware about it?

    Br,
    GB

  2. Thanks for feedback.
    You are correct. I think one reader already mentioned it in the other article’s comments so let me paste the workaround directly here from the link you provided so others can refer to it:

    08:53:31,375 User:System ERROR [security.sync.ChainingUserRegistrySynchronizer]
    Synchronization aborted due to error
    org.alfresco.error.AlfrescoRuntimeException: 01180001 User and group import failed
    at org.alfresco.repo.security.sync.ldap.LDAPUserRegistry.processQuery(LDAPUserRegistry.java:895)
    at org.alfresco.repo.security.sync.ldap.LDAPUserRegistry.getGroups(LDAPUserRegistry.java:623)
    …..
    Caused by: javax.naming.PartialResultException: Unprocessed Continuation Reference(s); remaining name ‘DC=testdomain,DC=foo’
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2793)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2767)
    at com.sun.jndi.ldap.LdapNamingEnumeration.getNextBatch(LdapNamingEnumer
    ation.java:129)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(LdapNamingEnumera
    tion.java:198)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMore(LdapNamingEnumeration
    .java:171)
    at org.alfresco.repo.security.sync.ldap.LDAPUserRegistry.processQuery(LD
    APUserRegistry.java:885)
    … 50 more

    This can be worked around modifying the bean ldapInitialDirContextFactory

    <bean id=”ldapInitialDirContextFactory” class=”org.alfresco.repo.security.authentication.ldap.LDAPInitialDirContextFactoryImpl”>

    defined in the file common-ldap-context.xml, adding the entry:

    <entry key=”java.naming.referral”>
    <value>follow</value>
    </entry>

  3. Punyabrota Dasgupta

    July 9, 2010 at 08:47

    I used this for an alfresco installation using fedora on Amazon EC2. worked perfectly fine (except for some very minor tweaks). Thanks a lot!

  4. Manuel Moura

    July 11, 2010 at 13:50

    Hi.

    I tried to run the script soffice but I get some errors:
    /etc/init.d/soffice: line 13: urp: command not found
    /etc/init.d/soffice: line 43: restart}”: command not found

    Can you help me?
    Thanks

  5. I had a problem with Share. Alfresco worked fine when I tested it from the browser. But Share just shows a blank page. Anyone have an idea why that is so?

    Thanks for the great tutorial. It really helped.

  6. Charles Gruener

    July 23, 2010 at 16:37

    Awesome instructions.

    Any idea how to install the Sharepoint Protocol Support AMP? All instructions assume an amps directory and the Module Management Tool (MMT) are used, which this installation doesn’t have. I can unzip the vti-module.amp but don’t know where to put the files.

    Thanks.

  7. Alfresco community WAR you downloaded includes the folder “commands” which includes all required tools for Linux.

  8. Muy bueno el manual se instalacion, la consola web funciona bien, sin embargo tengo problamas con el cifs, ya que me aparece este error:

    ERROR [org.alfresco.fileserver] [SMB] Server error : org.alfresco.jlan.server.config.InvalidConfigurationException: Error initializing TCP-IP SMB session handler, Permission denied

    favor si alguien sabe como remediarlo se lo agradecere

  9. You tutorial was awesome!

    Now that we have things rolling though we did an import of 300+ docs (via a ZIP file) and OpenOffice has had a high load for over 18 hours.. See our question to the forum here.

    http://forums.alfresco.com/en/viewtopic.php?f=9&t=28523

    Have you had issues with OpenOffice on CENTOS?

  10. Hi.

    I tried to run the script soffice but I get some errors:
    /etc/init.d/soffice: line 13: urp: command not found
    /etc/init.d/soffice: line 43: restart}”: command not found

    Can you help me?
    Thanks

    Your problem here is you probably copied the code directly off this page and are getting weird formatting issues(IE your ” and ‘ are probably periods .)

    Just open the file up with vi editor to correct the formatting issues.

    Hope this helps!

  11. I have tried to follow your tutorial, but i cannot dowload jdk-6u20-linux-x64.rpm.bin or 6u21 since everytime I try to download the sun site tells me that my transaccion cannot be approved. As far as I know my country (Panama) has been a US ally since 1920, so this is not export control stuff.
    any torrent to download it from?

  12. I searched on http://www.xlpar.com for the JDK jdk-6u21-linux-x64-rpm.bin and downloaded it. In case anybody else wants it.

    Also, if you’re installing on Centos 5.5 64bit, you will have an issue with “Missing Dependency: /usr/bin/rebuild-security-providers is needed by package….” when doing “yum update”.

    Apparently Redhat released a version of jpackage-utils that includes the dependency, and the problem comes in when the Redhat version of jpackage-utils is replaced by the JPackage version of jpackage-utils.

    So to fix do this:
    to remove jpackage ignoring dependencies
    #rpm -e jpackage-utils –nodeps

    to configure jpackage repo
    #cd /etc/yum.repos.d
    #wget ‘http://www.jpackage.org/jpackage50.repo’

    to install again jpackage
    # yum install jpackage-utils

    Cheers,

  13. Zied FAKHFAKH

    August 22, 2010 at 19:37

    @Erick Perez
    you can go safely with openjdk, you’ll need to install it like this:

    yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel

    EPEL repository must be configured: http://fedoraproject.org/wiki/EPEL/FAQ#howtouse

    after that proceed with the alternatives

  14. Zied FAKHFAKH

    August 22, 2010 at 19:42

    @Ivan thank you for this great article

    about Openoffice, giving this parameter in alfresco-global.properties, will be enough to connect Alfresco to OOO:

    ooo.exe=/usr/bin/soffice

    did not write the soffice script, any comment ?

  15. I think that for alternatives should be used directory /usr/java/latest as follows to allow easy upgrade of java

    alternatives –install /usr/bin/java java /usr/java/latest/bin/java 100
    alternatives –install /usr/bin/jar jar /usr/java/latest/bin/jar 100
    alternatives –install /usr/bin/javac javac /usr/java/latest/bin/javac 100

  16. Section to install alfresco should be

    wget http://dl.alfresco.com/release/community/build-2860/alfresco-community-war-3.3g.tar.gz
    tar xzf alfresco-community-war-3.3g.tar.gz
    unzip alfresco.war -d /usr/share/tomcat6/webapps/alfresco
    unzip share.war -d /usr/share/tomcat6/webapps/share
    cp -r endorsed /usr/java/latest/jre/lib/
    cp -r extensions/* /usr/share/tomcat6/shared/classes/alfresco/
    mysql -u root -p > log4j.appender.File.File=/var/log/tomcat6/alfresco.log
    nano /usr/share/tomcat6/webapps/share/WEB-INF/classes/log4j.properties
    >> log4j.appender.File.File=/var/log/tomcat6/alfresco.log

    (fixed path to java (using latest) and path to alfresco log4j.properties (missing alfresco))

  17. Thanks a lot, Ivan!

    There are some little typos in the code, but redeyed linuxoids like me will easily avoid errors 🙂

    Great work, Ivan, thanks once more.

  18. Bojan Markovic

    January 7, 2011 at 10:23

    Actually in my experience Alfresco works much more stable on CentOS x64 if it runs using OpenJDK 6. Tho this experience is based on using the alfresco binary installer (the bundle that has it’s own mysql, oo.o and tomcat) and not WAR. OTOH internal imagemagick, swftools and oo.o don’t work so well so what I do is get IM via yum, compile swftools 0.9.1, and use binary rpm installers of latest openoffice, and then just change alfresco-global.properties and /openoffice/scripts/ctl.sh to point to my custom locations of the software. Works like a charm.

    Also the initial database setup is not set for utf-8. You need to change /mysql/my.cnf and /mysql/scripts/ctl.sh to setup default charset to utf8 anc dollation to utf8_general_ci to be able to use non-latin1 characters in filename and most of metadata.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2025 Another Stranger Me

Theme by Anders NorenUp ↑