13 Oct

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

To make the alfresco user able to run the administrator commands, we have to add it to the so called ‘sudoers’. If you think this is a security risk (and you are probably right from a strict point of view), no matter but the following commands will be a little bit different.

adduser alfresco sudo

The change will take effect the next time the user logs in. 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/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

For the Ubuntu 14.10 users, the commands to be used are the ones described below. Rumors says that for Ubuntu 15.04 the package will restored in the standard repository. 😉

sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
sudo apt-get update
sudo apt-get install ffmpeg-real

SWFTools

sudo apt-get install libjpeg62 libgif4 libart-2.0-2
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 ‘whereis soffice’, 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" />

And then:

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
# Used from Solr4.
mkdir -p /opt/alfresco/alf_data/keystore

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

Once that Alfresco is up and running, the last task is to switch off the database update.

nano /opt/alfresco/tomcat/shared/classes/alfresco-global.properties

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

...
db.schema.update=false
...

34 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

    • Francesco Corti

      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?

    • Francesco Corti

      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

  5. Today is ready for download 5.0.c too.
    If someone install it on linux pleas posts changes in the installation path.
    Tks in adv

  6. Hi, when start alfresco in catalina.out file i see these errors:

    log4j:ERROR setFile(null,true) call failed.
    java.io.FileNotFoundException: alfresco.log (Permission denied)

    I’ve tried :

    # sudo mkdir /var/log/alfresco
    # sudo nano /opt/alfresco-3.4.d/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties

    — change “log4j.appender.File.File=alfresco.log” to “log4j.appender.File.File=/var/log/alfresco/alfresco.log”

    With restart Alfresco but no luck.

    • Francesco Corti

      Hi Francesco,
      This happens when the user that performs the start of the service has not the right permits on the folders/files.
      I suggest you to pay lot of attention to the users and permits during installation process… and please: avoid root user! 😉

  7. Hi farnsesco

    thanks for your post.
    For alfresco fast startup better to use below memory setup.
    it will allot 2 gb ram and makes it much faster.

    JAVA_OPTS=”-XX:MaxPermSize=160m -XX:NewSize=256m -Xms512m ”
    JAVA_OPTS=”$JAVA_OPTS -Xmx2048m -Xss512K “

  8. Hello Johanne,
    yes this the link from where I pretty successfully installed alfresco 🙂
    but I cannot remember or was pretty sure that I’ve not been asked to generate credentials for alfresco (I I cannot remember at all 🙁
    So now I’ve git problem logging in … what is initial username & pwd ? the only link I can get something from would be : http://x.x.x.x/share/page/ Alfresco community login and system responded with : Your authentication details have not been recognized or Alfresco may not be available at this time. (so maybe alfresco is not running ?

    Thank you very much in advance for your help
    and

    BR

    Tonci

    • Francesco Corti

      Hi Tonci,
      You can access to Alfresco using admin/admin.
      If you will not access with it, there is an installation issue somewhere.
      In this case I suggest you to look carefully to the catalina.out.
      Cheers.

  9. Hi Francesco

    which RDMS will you recomend for alfresco 5 postgresql or mysql.
    i have tried both but am not sure which one will be better for
    alfresco 5 on debian linux .can you please share your thoughts on this.

    • Francesco Corti

      Hi Ayoub,
      Alfresco CE is certified with both the RDBMS and in every case it uses the DB in a “standard way” without particular commands or tricky queries.
      If you take a look to the wizard, it is able to install only PostgreSql.
      I don’t think they are closing this choice but in every case I usually prefer PostgreSql… IMHO I think it’s “more open source” and in every case stable. 😉

  10. Hi Francesco,

    I installed alfresco 5.0c on a 32bit Ubuntu 14.04 LTS following your instructions. Thanks a lot for your work. I had some issues with: ERROR [solr.core.CoreContainer] [coreLoadExecutor-5-thread-1] Unable to create core: collection1 … maybe the same problem as Sebastian.

    But in general it’s working 🙂 on a little bit outdated server pc: 4 core xeon cpu (32bit) / 4 gb ram. But it’s only for evaluation and learning. Ok, regards from Aachen, Germany

  11. hi Francesco

    sudo add-apt-repository ppa:jon-severinsson/ffmpe

    is not working

    and i don’t know in which step the java is installed ??

    thnx

  12. Great work, Francesco!

    My two pennies worth of discovery is that you need to make sure you have no errors in catalina.out before you set “db.schema.update=false” in alfresco-global.properties. Although I have rectified all the insufficiency, I could not get rid of an error message like below whenever I start the alfresco service (“service alfresco start”):

    Caused by: org.postgresql.util.PSQLException:
    ERROR: current transaction is aborted, commands ignored until end of
    transaction block

    I stopped the service, re-instated the db.schema.update and re-started the service. It started to work like a charm. Without knowing a great deal, I figured the update variable allows the Alfresco to run a check and facilitate the db access somehow.

  13. Great share Francesco Corti,

    I have installed Alfresco 5.0.d Community Edition with the help of your guide.

    Below changes I have modified before starting the alfresco

    1. Removed folders alfresco/ ROOT/ share/ solr4/ from /opt/alfresco/tomcat/webapps/
    cd /opt/alfresco/tomcat/webapps/
    rm -Rf alfresco/ ROOT/ share/ solr4/
    2. Added cifs parameters in /opt/alfresco/tomcat/shared/classes/alfresco-global.properties
    cifs.enabled=true
    cifs.serverName=XXXXXXXX (Servername)
    cifs.domain=XXXXXXXXX.com (Domain Name)
    cifs.hostannounce=true
    cifs.sessionTimeout=1800
    cifs.ipv6.enabled=false
    cifs.tcpipSMB.port=1445
    cifs.netBIOSSMB.namePort=1137

    There were no issues after adding those parameters.

    Thank you

    added

  14. Hi Francesco

    I have installed Alfresco 5.0.a Community Edition with the help of your guide but I have a problem. I can’t access to Alfresco using admin/admin. There are another username and password to access?

    Please help me

  15. Hi Francesco,

    The following steps also helps,

    /opt/alfresco/tomcat/lib/mysql-connector-java-5.1.37-bin.jar (MySQL Database)
    chown -R alfresco:alfresco /opt/alfresco (as a final step)

    Regards,
    Jojan Paul

  16. Hello Francesco Corti,

    I have installed alfresco-community-5.0.a.
    The following steps are mandatory as a final step.
    chmod 755 /opt/alfresco/tomcat/lib/mysql-connector-java-5.1.37-bin.jar (for MySQL database)
    chown -R alfresco:alfresco alfresco

    Regards,
    Jojan Paul

  17. Excelente, muchas gracias funciono todo bien

    Ahora necesito aprender a hacer bakcup y luego voy por AAAR

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.