How to install Alfresco 5.0.a Community Edition on Ubuntu 14.04 LTS

alfresco logoAfter the development of my most viewed post sharing how to install Alfresco 4.2.c on Ubuntu 10.04 LTS (more than 35.000 views) and Windows Server 2008 R2 (more that 13.000 views), it’s time to update the tutorial to the newest major version of Alfresco: Alfresco Community Edition 5.0.a. Even if the 5-th version is quite different from the 4-th version, the installation process is more or less the same… but let’s describe exactly the differences. The operating system choosen for the tutorial is Ubuntu 14.04.01 LTS.

Differently from the other post, the tutorial is separated in two parts: the installation of the dependencies and the Alfresco installation. As we like and prefer, the installation is a step by step list of commands and tasks: simpler to understand, to do and to test. Hope you’ll be agree.

Part 1 – Installation of the dependencies

Starting from a vanilla installation of Ubuntu O.S. 14.04.01 LTS, let’s update the libraries and configurations.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get purge openjdk-\*

Now it’s time to add a new user called alfresco, we will use for the installation (password: alfresco).

adduser alfresco
Enter new UNIX password: alfresco

Starting from now we will work as alfresco user.

su – alfresco

JDK 1.7u67

Even if Alfresco 5.0.a is certified with Java1.7U60, we use Java1.7U67 (nothing serious will happen). You can download the package from Oracle Java SE Downloads. In our case the package is ‘jdk-7u67-linux-x64.tar.gz’.

sudo mkdir -p /opt/java

Unzip the package in it. In our case in the ‘/opt/java/jdk1.7.0_67’. Please remember to set the permits to the folder to ‘execute’ (use can use chmod command).

sudo nano /etc/profile.d/java.sh
export JAVA_HOME=/opt/alfresco/java/jdk1.7.0_67
export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin

Save and exit.

java -version

ImageMagick

sudo apt-get install ghostscript imagemagick
convert --version

Using the command ‘whereis convert’, please check the result is ‘/usr/bin/convert’. If not, copy and use it in the ‘img.exe’ parameter into the alfresco-global.properties file.

FFMPeg

sudo add-apt-repository ppa:jon-severinsson/ffmpeg
sudo apt-get update
sudo apt-get install ffmpeg

SWFTools

sudo apt-get install libjpeg62 libgif4
wget http://archive.canonical.com/ubuntu/pool/partner/s/swftools/swftools_0.9.0-0ubuntu2_amd64.deb
chmod a+x swftools_0.9.0-0ubuntu2_amd64.deb
sudo dpkg -i swftools_0.9.0-0ubuntu2_amd64.deb

Using the command ‘whereis pdf2swf’, please check the result is ‘/usr/bin/pdf2swf’. If not, copy and use it in the ‘swf.exe’ parameter into the alfresco-global.properties file.

LibreOffice

sudo apt-get install libreoffice

Using the command ‘whereissoffice’, please check the result is ‘/usr/bin/soffice’. If not, copy and use it in the ooo.exe’ and ‘jodconverter.officeHome’ parameters into the alfresco-global.properties file.

PostgreSql

Even if Alfresco 5.0.a is certified with PostgreSql 9.2.4, we use PostgreSql 9.3.5 (nothing serious will happen).

sudo apt-get install postgresql postgresql-contrib
sudo passwd postgres
postgres

Now it’s time to prepare the (empty) database schema for Alfresco.

sudo -u postgres psql postgres
CREATE ROLE alfresco WITH PASSWORD 'alfresco' LOGIN;
CREATE DATABASE alfresco WITH OWNER alfresco;
<ctrl+d>
sudo -u alfresco psql alfresco
ALTER USER alfresco WITH PASSWORD 'alfresco';
<ctrl+d>

Tomcat

Even if Alfresco 5.0.a is certified with Tomcat 7.0.53, we use Tomcat 7.0.55 (nothing serious will happen). You can download the package from Apache Tomcat. In our case the package is ‘apache-tomcat-7.0.55.tar.gz’.

sudo mkdir -p /opt/alfresco
sudo chown alfresco:alfresco /opt/alfresco

Unzip the package in ‘/opt/alfresco’ renaming the apache-tomcat folder in ‘tomcat’.

sudo chown -R alfresco:alfresco /opt/alfresco/tomcat
/opt/alfresco/tomcat/bin/startup.sh
ps -ef | grep java

You can check the existence of the java process. Alternatively you can access to http://localhost:8080/ using your browser.

/opt/alfresco/tomcat/bin/shutdown.sh

Part 2 – Installation of Alfresco

Now that everything is ready, we can proceed to install Alfresco into the environment.

Alfresco 5.0.a

cp /opt/alfresco/tomcat/conf/catalina.properties /opt/alfresco/tomcat/conf/catalina.properties.orig
nano /opt/alfresco/tomcat/conf/catalina.properties

Set the ‘shared.loader’ parameter with the value described below.

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

Save and exit.

cp /opt/alfresco/tomcat/conf/server.xml /opt/alfresco/tomcat/conf/server.xml.orig
nano /opt/alfresco/tomcat/conf/server.xml

Add ‘URIEncoding=”UTF-8″‘ to ‘<Connector port=”8080″ protocol=”HTTP/1.1″…’.

 nano /opt/alfresco/tomcat/conf/context.xml

Add the line below:

<Valve className="org.apache.catalina.authenticator.SSLAuthenticator" securePagesWithPragma="false" />
mkdir -p /opt/alfresco/tomcat/shared
mkdir -p /opt/alfresco/tomcat/shared/classes
mkdir -p /opt/alfresco/tomcat/shared/lib
mkdir -p /opt/alfresco/tomcat/endorsed

Download Alfresco Community Edition from Sourceforge. The package is named ‘alfresco-community-5.0.a.zip’. Unzip the package in a temporary folder and you will find a folder named ‘alfresco-community-5.0.a’.

cd .../alfresco-community-5.0.a
cp -R bin /opt/alfresco
cp -R web-server/endorsed/* /opt/alfresco/tomcat/endorsed
cp -R web-server/shared/* /opt/alfresco/tomcat/shared
cp -R web-server/lib/* /opt/alfresco/tomcat/lib
cp -R web-server/webapps/* /opt/alfresco/tomcat/webapps/

You can remove the folder named ‘alfresco-community-5.0.a’.

nano /opt/alfresco/start_oo.sh
#!/bin/sh -e

SOFFICE_ROOT=/usr/bin
"${SOFFICE_ROOT}/soffice" "--accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" --nologo --headless &

Save and exit.

chmod uga+x /opt/alfresco/start_oo.sh
/opt/alfresco/start_oo.sh
ps -ef | grep soffice

You can check the existence of the soffice process.

killall soffice.bin
nano /opt/alfresco/alfresco.sh
#!/bin/sh -e

# Start or stop Alfresco server

# Set the following to where Tomcat is installed
ALF_HOME=/opt/alfresco
cd "$ALF_HOME"
APPSERVER="${ALF_HOME}/tomcat"
export CATALINA_HOME="$APPSERVER"

# Set any default JVM values
export JAVA_OPTS='-Xms512m -Xmx768m -Xss768k -XX:MaxPermSize=256m -XX:NewSize=256m -server'
export JAVA_OPTS="${JAVA_OPTS} -Dalfresco.home=${ALF_HOME} -Dcom.sun.management.jmxremote"

if [ "$1" = "start" ]; then
 "${APPSERVER}/bin/startup.sh"
 if [ -r ./start_oo.sh ]; then
  "${ALF_HOME}/start_oo.sh"
 fi
elif [ "$1" = "stop" ]; then
 "${APPSERVER}/bin/shutdown.sh"
 killall -u alfresco java
 killall -u alfresco soffice.bin
fi
chmod uga+x /opt/alfresco/alfresco.sh
sudo nano /etc/init.d/alfresco
 #!/bin/sh -e

ALFRESCO_SCRIPT="/opt/alfresco/alfresco.sh"

if [ "$1" = "start" ]; then
 su - alfresco "${ALFRESCO_SCRIPT}" "start"
elif [ "$1" = "stop" ]; then
 su - alfresco "${ALFRESCO_SCRIPT}" "stop"
elif [ "$1" = "restart" ]; then
 su - alfresco "${ALFRESCO_SCRIPT}" "stop"
 su - alfresco "${ALFRESCO_SCRIPT}" "start"
else
 echo "Usage: /etc/init.d/alfresco [start|stop|restart]"
fi
sudo chmod uga+x /etc/init.d/alfresco
sudo chown alfresco:alfresco /etc/init.d/alfresco
mkdir /opt/alfresco/alf_data
cp /opt/alfresco/tomcat/shared/classes/alfresco-global.properties.sample /opt/alfresco/tomcat/shared/classes/alfresco-global.properties
nano /opt/alfresco/tomcat/shared/classes/alfresco-global.properties

Below the lines to replace or add to the properties file.

dir.root=/opt/alfresco/alf_data
...
db.username=alfresco
db.password=alfresco
...
# OpenOffice
ooo.exe=/usr/lib/libreoffice/program/soffice.bin
ooo.enabled=true
jodconverter.officeHome=/usr/lib/libreoffice
jodconverter.portNumbers=8100
jodconverter.enabled=true
# ImageMagick installation
img.root=/usr/share/doc/imagemagick
img.exe=/usr/bin/convert
# SWFTools exe
swf.exe=/usr/bin/pdf2swf
...
db.schema.update=true
...
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/alfresco
...
index.recovery.mode=AUTO
...
authentication.chain=alfrescoNtlm1:alfrescoNtlm

Now everything is ready to start alfresco but, please, pay attention now. Check very carefully the log during the first run. Pay attention to the ERRORS and the reasons why the errors are thrown.

service alfresco start
tailf /opt/alfresco/tomcat/logs/catalina.out

For example, the lines below are caused by the missing configuration of FTP and CIFS. Enjoy!

2014-09-22 22:01:32,203 ERROR [org.alfresco.fileserver] [FTP Server] [FTP] FTP Socket error : java.net.BindException: Permission denied
...
2014-09-22 22:01:32,210 ERROR [org.alfresco.fileserver] [CIFS Server] [SMB] Server error : org.alfresco.jlan.server.config.InvalidConfigurationException: Error initializing TCP-IP SMB session handler, Permission denied

Advertisements

10 thoughts on “How to install Alfresco 5.0.a Community Edition on Ubuntu 14.04 LTS

  1. Thanks for the cargo!

    I had an issue with :URIEncoding=”UTF-8″‘ to ‘<Connector port=”8080″ protocol=”HTTP/1.1″…’"

    Apache Tomcat/7.0.56 will not accept this in the conf/server.xml

    I get various issues including:
    Open quote is expected for attribute "{1}" associated with an element type "URIEncoding"

    If I remove UTF, then it starts correctly.

  2. I appreciate your effots in producing this install but: there are always some people that are not command line or fully conversant with some of the linux rules. I for on cannot get my head around tar.gz etc files si I do not understand how to (JDK 1.7u67) Unzip the package in it. In our case in the ‘/opt/java/jdk1.7.0_67′. Please remember to set the permits to the folder to ‘execute’ (use can use chmod command).
    If you can spare the time with this old aged newbie I would appreciate your guidance. Alfresco Community Edition will be of considerable help to my charity and other charities I work with.
    Regards,
    SyMartin

    • Hi Syd Martin,
      Thank you for the interest in this post but unfortunately some basic knowledge is necessary to develop this… we have also to consider that Alfresco is not so “simple” to manage from a sysadmin point of view.
      Why don’t you consider the wizard as tool for installation?
      I strongly suggest you this way as the best way for you and your target in your Organization.

  3. This is not working for 5.0b because of the solr change. I cant figure out where to put what folder in alf_data there is some solr folder and another folder called solr4 but where to put it?

    • Hi Sebastian,
      Thank you for the feedback.
      I didn’t try on 5.0.b but I think the one you submit is one the small changes.
      Please, let us know if you find the correct settings.
      Thank you in advance.

  4. When install SWFTOOLS you must install libart-2.0-2 with libjpeg62 libgif4:
    sudo apt-get install libjpeg62 libgif4
    become:
    sudo apt-get install libjpeg62 libgif4 libart-2.0-2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s