cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco WAR install guide for Ubuntu 10.04

citizenkane
Champ in-the-making
Champ in-the-making
I have experienced that running Alfresco 3.4d from the install binaries on a system running other services and servers is most unreliable and buggy. (Not to mention that the whole install runs as root!)

Doing a clean install from the WAR using a Postgresql database is much more stable and efficient. (and it runs as a non-privelidged user)

Here is how on a 64bit Zentyal server (Ubuntu 10.04 based)

Thanks to:
http://blog.mycroes.nl/2010/04/installing-alfresco-33-on-ubuntu-lucid.html
from which this guide is expanded from.

Install additional apps
sudo apt-get install imagemagick swftools sun-java6-jre postgresql

I have had endless trouble with OpenOffice "breaking" and being unable to convert docs for preview. I find Libreoffice is much more reliable, besides the log error it throws regarding not being able to find the openoffice version. So:

sudo apt-get purge openoffice.org ure
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice

Install Tomcat6 from the Ubuntu repo
sudo apt-get install tomcat6
Install Tomcat native libraries
sudo apt-get install libtcnative-1

Download the Alfresco WAR from
http://process.alfresco.com/ccdl/?file=release/community/build-3370/alfresco-community-3.4.d.zip
and unzip into
~Downloads/alfresco


sudo service tomcat6 stop

Copy the following:
sudo cp -r ~/Downloads/alfresco/web-server/shared /var/lib/tomcat6
sudo cp -r ~/Downloads/alfresco/web-server/webapps /var/lib/tomcat6
sudo cp -r ~/Downloads/alfresco/web-server/lib /var/lib/tomcat6/shared/lib
sudo cp -r ~/Downloads/alfresco/bin /var/lib/tomcat6/bin
sudo cp -r ~/Downloads/alfresco/licenses /var/lib/tomcat6/licenses
sudo cp -r ~/Downloads/alfresco/README.txt /var/lib/tomcat6/README.txt
sudo rm /var/lib/tomcat6/shared/lib/mysql-connector-java-5.1.13-bin.jar

Download the JDBC drivers for Postgresql from
http://jdbc.postgresql.org/download.html
to ~/Downloads and
sudo cp ~/Downloads/postgresql-9.0-801.jdbc3.jar /var/lib/tomcat6/shared/lib/postgresql-9.0-801.jdbc3.jar
sudo su

Then

mv /var/lib/tomcat6/shared/classes/alfresco-global.properties.sample /var/lib/tomcat6/shared/classes/alfresco-global.properties
mv /var/lib/tomcat6/shared/classes/alfresco/web-extension/share-config-custom.xml.sample /var/lib/tomcat6/shared/classes/alfresco/web-extension/share-config-custom.xml

nano /var/lib/tomcat6/conf/catalina.properties
and change the "shared.loader=" line to
shared.loader=${catalina.home}/shared/classes,${catalina.home}/shared/*.jar,/var/lib/tomcat6/shared/classes,/var/lib/tomcat6/shared/lib/*.jar

Java does not handle memory for Alfresco suitably "out of the box" and you have to configure it in this file:

nano /etc/default/tomcat6

The following needs to be set:
JAVA_HOME=/usr/lib/jvm/java-6-sun
JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=512m -Xms128m -Xmx768m -Dalfresco.home=/opt/alfresco -Dcom.sun.management.jmxremote"


If you have a single CPU with one or dual cores:

JAVA_OPTS="${JAVA_OPTS} -XX:+CMSIncrementalMode" (note the typo of missing brackets in the default file)

These can vary to suite your needs and resources and more can be read here:
http://www.alfresco.com/help/34/community/all/
under "Tuning the JVM"

Create a Postgresql database of UTF8 called "alfresco"
Create a directory for your data in a place of your choosing, eg

mkdir -p /srv/www/alfresco/alf_data

Ensure the user you are running Tomcat as has the correct access permissions:
chown -R tomcat6:tomcat6 /var/lib/tomcat6 /srv/www/alfresco

Set the Alfresco properties to suite your system:

nano /var/lib/tomcat6/shared/classes/alfresco-global.properties

eg.
web.application.context.url=http://127.0.0.1:<yourport>/alfresco

ooo.exe=/usr/lib/libreoffice/program/soffice
ooo.enabled=true
jodconverter.officeHome=/usr/lib/libreoffice       
jodconverter.portNumbers=8101
jodconverter.enabled=true
img.root=/usr/lib/ImageMagick-6.5.7
img.exe=/usr/bin/convert
swf.exe=/usr/bin/pdf2swf

db.driver=org.postgresql.Driver
db.url=jdbcSmiley Tongueostgresql://localhost:5432/alfresco



IF YOU NEED TO CHANGE THE DEFAULT PORTS:

The default port is 8080. There are a number of places you need to change this if, for eg. you need to use 8180.
Find and replace :8080 to :8180 in the following places:
/etc/tomcat6/server.xml
/var/lib/tomcat6/shared/classes/alfresco-global.properties
/var/lib/tomcat6/shared/classes/alfresco/web-extension/share-config-custom.xml

In share-config-custom.xml be sure to uncomment the "example port config used to access remote Alfresco server" section at the bottom and revise your port number.

You should now be good to go!
service tomcat6 start
Browse to:
http://<yourip>:<yourport>/share (it will take a few minutes to start up)
Default user and password is:
admin admin

You can find your log files in:
/var/lib/tomcat6/alfresco.log
/var/lib/tomcat6/log/catalina.out

Good Luck!
19 REPLIES 19

mrogers
Star Contributor
Star Contributor
Great stuff. Smiley Happy
a)  How about updating the community wiki so others will find the information.
b) If you have issues with the installers please make sure you raise them in JIRA.
c) I didn't see you setting tomcat's class loader to include the shared folder.

citizenkane
Champ in-the-making
Champ in-the-making
No problems.

This is still a "rough guide" and I will update it as I go through the teething pains and then publish to the Wiki.

Could you please give some brief clues as how to "setting tomcat's class loader to include the shared folder" and I will update the guide.

There is nothing in itself wrong with the installer (it installs and runs). For my particular system though it seems to, in mysterious ways, slow down some of my Apache server sites and completely break (at random times) my Zentyal web interface before it in itself going to the notorious "404" page for alfresco. Nothing I can put my finger on - but I suspect it is about port reservations and conflicts. The WAR install seems to have resolved these strange artefacts. Also - running a webapp as root makes me nervous.

sasquatch58
Champ in-the-making
Champ in-the-making
The standard Ubuntu 10.04 server installation doesn't support ppa out of the box - you have to add some code to get this.
Change this code from:
sudo apt-get purge openoffice.org ure
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice

to:
sudo apt-get purge openoffice.org ure
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice

If you don't want the Postegresql installation, then the install notes in Mycroe's blog (link in original post) will give you all the details for the mysql installation.
For those who have an existing War installation, you can change from OpenOffice to LibreOffice using the above code. I suggest shutting down Tomcat first, then changing your alfresco-global.properties. With my installation I found I didn't have to uncomment the Mysql connection code for it to work as I am running a separate symlink for this as per Mycroes notes.
Restart Tomcat and you should be up and running (after the usual wait).
There's no debate over Postgresql vs Mysql - each has it's merits and it comes down to user choice/ preference.

Cheers, Sasquatch

walkperp
Champ in-the-making
Champ in-the-making
Thank you for the guide. I have followed as best as I can.

Tomcat seems to be working fine on default port 8080.
http://<myip>:8080/share works but user/pass admin/admin fails to log me in.

I have missed one I believe important step.
'Create a Postgresql database of UTF8 called "alfresco"'
Could you please explain this step more or provide a helpful link.

The directory /srv/www/alfresco/alf_data was created and remains empty

http://<myip>:8080/alfresco does nothing, although I am not sure it is.

Thank you once again for all effort & time.

sasquatch58
Champ in-the-making
Champ in-the-making
Creating the database (Mysql or Postgresql) is an absolute must do, without it Afresco will not work.
Read Mycroes blog for a guide, also the Alfresco Community install notes.
For Mysql:
user@server:~$ mysql -u root -p
mysql> CREATE DATABASE alfresco DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
mysql> GRANT ALL PRIVILEGES ON alfresco.* TO alfresco@localhost IDENTIFIED BY 'alfresco';
mysql> GRANT SELECT,LOCK TABLES ON alfresco.* TO alfresco@localhost IDENTIFIED BY 'alfresco';
mysql> FLUSH PRIVILEGES;
mysql> quit;
Check that the rest of your installation is OK, including the alfresco-global.properties settings.
Kick it into life - I find with the WAR version,
sudo /etc/init.d/tomcat6 restart
works fine or use the Tomcat Manager.

Cheers, Sasquatch

heiko_robert
Star Collaborator
Star Collaborator

cjimenez2581
Champ in-the-making
Champ in-the-making
Hello I followed all steps and I can see <My-IP>/share/page/site-index but I cant log in because I dont know the pass… Here we never set it up

quietas
Champ on-the-rise
Champ on-the-rise
Thanks for you concise instructions, I followed the steps and all worked great. I would add in the specific steps to change the postgres user password.

sudo su postgres
psql -d template1
alter user postgres with password '<yourpasswordhere>';
\q

quietas
Champ on-the-rise
Champ on-the-rise
It looks like Christopher is correct, I also cannot log in using admin/admin or Administrator/Administrator as I have seen in other guides.