Friday, September 14, 2007

Installing Alfresco 2.1.0 WCM + Ubuntu Linux + Oracle 10 Express Edition

Once have successfully installed and configured Oracle (to know how to install Oracle 10 Express look here) you can install a fresh copy of Alfresco version 2.1.0 (AlfrescoEnterprisePlusWCM-2.1.0-Linux-x86-Install.zip), the zip file provide two different installer:

AlfrescoEnterprise-2.1.0-Linux-x86-Install.bin

AlfrescoWCMEnterprise-2.1.0-Linux-x86-Install.bin

I started with AlfrescoEnterprise-2.1.0-Linux-x86-Install.bin.

The installation process it is quite easy to complete, accept the license agreement, choose the destination folder and resolve a question: do you want use the jdk and openoffice already locally installed or do you want download these necessaries components? we don't need anything. We can install both JDK and OpenOffice via apt-get and anyway, we'll see later, the only thing we need is to know where JDK and OpenOffice are. The path to setup properly the startup scripts.

After the install wizard choose to start the configuration wizard and you will be asked for:
  • Database Type - choose Oracle;
  • Content Store Location - the directory where Alfresco will store files and other stuff, leave the default if you don't have particular needs;
  • Index Location - another directory for the indexes, leave the default if you don't have particular needs;
  • OpenOffice Installation Directory - /usr/lib/openoffice (if you have openoffice installed through apt-get) anyway this parameters will never be used because the configuration wizard have some bugs.

Now I had to setup the database connection to Oracle. I didn't find any documentation in the setup to configure an Oracle connection but adjust the instruction write for MySql (README_mysql.txt), I hope, it will be quite easy, you have to create an account called alfresco using the Oracle 10 apex console (http://localhost:8090/apex/)

To setup the Oracle connection, you need to look 2 files from the $ALFRESCO_HOME/tomcat/shared/classes/alfresco/extension directory. Those files are custom-repository.properties and custom-hibernate-dialect.properties:
  1. custom-repository.properties
    • uncomment the account info and adjust as appropriate:
      #
      # Sample database connection properties
      #
      db.username=alfresco
      db.password=alfresco
      db.pool.initial=10
      db.pool.max=100

    • uncomment the Oracle connection lines and adjust as appropriate (pay particular attention to the SID, in our case is XE)
      #
      # Oracle connection (requires ojdbc14_g.jar or equivalent jar in shared libraries location)
      #
      db.driver=oracle.jdbc.OracleDriver
      db.url=jdbc:oracle:thin:@localhost:1521:XE

    • comment out any other connection lines using #

  2. custom-hibernate-dialect.properties -
    • comment out any other dialect line using #
      #
      # Oracle dialect
      #
      hibernate.dialect=org.hibernate.dialect.Oracle9Dialect

copy the ojdbc14_g.jar in the tomcat common lib:

cp $ORACLE_HOME/jdbc/lib/ojdbc14_g.jar alfresco/tomcat/common/lib/

If you have an oracle client you could check the oracle connection with the following command:

$ sqlplus alfresco/alfresco@XE

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 17 22:47:32 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> quit

Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

Looking at the startup script I see the Alfresco 2.1.0 configuration wizard have a bug, the @@ALFRESCO_DIR@@ should be replaced in the admin scripts with the correct path. Anyway this did not happened, so I had to patch all the scripts present in the installation directory (Be sure to be in the correct directory before submit this!):

$ perl -i -p -e 's/\@\@ALFRESCO_DIR\@\@/\/home\/freedev\/apps\/servers\/alfresco-2.1.0/g' *.sh

So I hoped to have resolved all installation problems, but JDK and OpenOffice although were downloaded successfully, during the package decompression many binary files necessaries to the execution did not have the execution permission, so the installation... well, I think you understand. Fortunately install a new package (i.e. JDK) under Ubuntu it is really easy:

sudo apt-get install sun-java6-jdk

and remove everything related the gcj:

sudo apt-get remove gcj-4.1-base

Finally to fix the startup scripts we need to create two link one to configure the JAVA_HOME in the startup scripts and another to allow the script to find OpenOffice:

ln -s /usr/lib/jvm/java-6-sun-1.6.0.00/ alfresco/java

ln -s /usr/lib/openoffice/ openoffice.org2.1

now we can finally try to start Alfresco.

$ ./alfresco.sh start