There's always time to play

Monday, February 1, 2010

Installing Alfresco on Ubuntu Jaunty (9.04)

Some of the information in here comes from Even though the guide is old, most of the information is still correct, albeit some file locations and names have changed and it's written for another distribution.

  1. Start with updating your system

    # apt-get update

  2. Install tomcat and mysql-connector

    # apt-get install tomcat6 libmysql-java

  3. Edit tomcat startup settings

    # /etc/defaults/tomcat6

    #JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"
    JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx512m"


    Take note of the fact I disabled security, otherwise you need to create a policy file with everything that is allowed in it. I guess it is not that hard, but I wanted to get Alfresco running at all first.

  4. Create the Alfresco root

    # mkdir /opt/alfresco
    # cd /opt/alfresco
    # wget
    # wget
    # wget
    # unzip

    # mkdir wcm
    # unzip -d wcm

  5. Create Alfresco database and user

    $ mysql -u root -p < extras/databases/mysql/db_setup.sql

  6. Create Alfresco and tomcat directories

    # mkdir -p /var/lib/alfresco/alf_data/
    # mkdir -p /var/lib/tomcat6/shared/{classes,lib}

  7. Add Alfresco and Alfresco share wars to tomcat

    # ln -s /opt/alfresco/alfresco.war /var/lib/tomcat6/webapps/
    # ln -s /opt/alfresco/share.war /var/lib/tomcat6/webapps/

  8. Add mysql connector to path where tomcat finds it

    # ln -s /usr/share/java/mysql-connector-java-1.5.6.jar /var/lib/tomcat6/shared/lib/mysql-connector-java.jar

  9. Add extension sample files to tomcat

    # unzip -d /var/lib/tomcat6/shared/classes/

  10. Setup Alfresco global settings

    cp /opt/alfresco/extensions/extension/ /var/lib/tomcat6/shared/classes/
    Edit the contents of the file:
    # /var/lib/tomcat6/shared/classes/


  11. Add WCM bootstrap

    # cp wcm/wcm-bootstrap-context.xml /var/lib/tomcat6/shared/classes/alfresco/extension/

  12. Setup catalina loader paths

    # /var/lib/tomcat6/conf/

  13. Fix permissions

    # chown -R tomcat6:tomcat6 /var/lib/{tomcat6,alfresco}

  14. Do a first run so the wars get extracted

    # /etc/init.d/tomcat6 restart

  15. Setup log file

     # /var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/


  16. Restart tomcat so log settings are re-read

    # /etc/init.d/tomcat6 restart

Now you should be able to reach Alfresco on [ip]:8080/alfresco and Alfresco Share on [ip]:8080/share.

Seems that Alfresco prefers to run on OpenJDK for me, getting out of memory errors when using Sun's JDK. However, if OpenJDK is installed on Jaunty, there's a symlink for rhino in /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar, which prevents loading of rhino included in the Alfresco WAR and will result in errors in Alfresco Share (and probably other places too). A # rm /usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar fixes this.