next up previous contents
Next: Add Users Up: SAKAI EVALUATION EXERCISE (A Previous: Evaluate new Work   Contents


WP 2 - Ease of Administration (EoA) of Sakai/ CHEF for a VRE.

This work package assessed the Ease of Administration (EoA) of Sakai/ CHEF for a VRE. Administration facilities in the chosen VRE framework are of paramount importance to its maintenance and extension. There are many questions that we have attempted to answer, e.g. How easy is it to add new users to Sakai/ CHEF?, Can we customise the portal ``skin'' in appropriate ways for existing e-Science projects?, Can we easily allow projects to create work sites for subsets of users in the portal and to include the tools they require from the given set?, Can we isolate users from specific work sites and create a secure access mechanism using certificates (e.g. with GridSite)?

This work package resulted in the production of a report (Evaluation Report 2) together with any software adapters developed during the assessment process. These adapters may be required to plug Sakai/ CHEF into Lancaster/ Daresbury authentication mechanisms and will serve as useful templates for other institutions.

Administration facilities in the chosen VRE framework are of paramount importance to its maintenance and extension. There are questions that we have attempted to answer:

Task Title Responsibility Description
2.1 Add users Lancaster How easy is it to add new users to Sakai?
2.2 Customisation Lancaster Can we customise the portal ``skin'' in appropriate ways for existing e-Science projects? demonstrators for ReDRESS, e-HTPX, e-Minerals and NGS
2.3 Worksite creation Lancaster Can we easily allow projects to create worksites for subsets of users in the portal and to include the tools they require from the given set?
2.4 Security Both Can we isolate users from specific worksites and create a secure access mechanism using certificates (e.g. with GridSite)?
2.5 Performance and scalability Both Investigate what server is required to host the VRE front end for a large project, e.g. using BladeCenter at Daresbury

We have additionaly included notes on the installation procedures for CHEF and for Sakai RC1 and RC2.

CHEF Installation

CHEF is a predecessor of Sakai. Sakai is also sometimes referred to as CHEF2. The CHEF portal framework is based on the following technologies.

The current public release of CHEF is 1.2.10. The software can be downloaded from http://chefproject.org/project/src/. The Chef software was installed on a Linux machine, thames.dl.ac.uk, running operating system Redhat WS release 3.

The CHEF portal can be seen at http://thames.dl.ac.uk:8080/chef/portal. The installation and deployment of CHEF portal was based on using the following software.

$\bullet$ ANT is a Java based build tool, Ref 6. Version 1.6.2
$\bullet$ PostgreSQL database used for content management. PostgreSQL version 7.4.3.
$\bullet$ Tomcat servlet container to host the Sakai portal. Tomcat version 5.0.27.

As with Sakai, CHEF by default only supports the MySQL and Oracle databases and changes were made to the SQL scripts in order to make CHEF work with the PostgreSQL database.

The installation and setting up of the PostgreSQL database is similar in Sakai. Before populating the CHEF database, the following changes need to be made to the SQL scripts,

Sakai RC1 Installation

Our documented installation procedure for Sakai is also available as a separate report [73]. It gives step by step instructions regarding the installation of a Sakai instance at the reader's institution. The document is aimed at a technical user with some experience in Apache Tomcat and PostgreSQL RDBMS administration.

Java Installation

  1. Go to the Sun Java website (http://java.sun.com/j2se/1.4.2/download.html) and download the Java SDK (Software Development Kit).
  2. Make the downloaded file executable and run it in the directory that you want the SDK installed in (I use '/usr/local').
  3. Create an environment variable called JAVA_HOME pointing to the directory that you just created in step 2. I export the environment variable in '/etc/profile'.

Maven Installation

  1. Go to the Apache Maven site (http://maven.apache.org/start/download.html) and download Maven.
  2. Expand the Maven archive into a directory (I use /usr/local). Create a symbolic link called maven pointing to the newly created Maven directory.
  3. Add '/usr/local/maven/bin' to your PATH environment variable.

Install and Configure Tomcat

  1. Go to the Apache Jakarta website (http://jakarta.apache.org/ and download Tomcat (I used versions 5.0.25 and 5.0.28 for the evaluation ,they both work OK).
  2. Expand the tomcat archive into a directory (I use '/usr/local')
  3. Create a symbolic link to the expanded directory called 'tomcat', the expanded directory will be called something like 'jakarta-tomcat-5.0.28'.
  4. Create an environment variable called 'CATALINA_HOME' pointing to the symbolic link that you just created in step 3. My entry is 'CATALINA_HOME=/usr/local/tomcat'.
  5. Create an environment variable called 'CATALINA_OPTS' and set it to '"-Xms128M -Xmx256M"'. My entry would be 'CATALINA_OPTS="-Xms256M -Xmx512M"'. The double quotes are essential. This permits the Java runtime to use up to 256MB of heap memory. Tomcat needs a LOT of heap memory, so if you have more memory available, increase the -Xmx part to half of what you have. A good rule of thumb is to use two thirds of what is available on a server that is mainly using tomcat, and half if it is a workstation being used for other purposes.

Download Sakai

  1. Go to the Sakai website (http://cvs.sakaiproject.org/release/1.0.b1/src/sakai-src.zip) and download the sakai source archive to your computer.
  2. Expand the archive into 'HOME_DIR/projects/sakai' or something similar, this directory will be referred to as 'SAKAI_SRC_DIR' for the duration of this document. I use '/home/fisha/projects/sakai'.

Download, Install and Configure PostgreSQL

Download

  1. Download the PostgreSQL source from http://www.postgresql.org
  2. Expand the source into your home directory. For me this would be '/home/fisha/src'.

Install

  1. Follow the instructions in the expanded source. They are in a file called INSTALL. When you have completed this process you will hopefully have a working PostgreSQL database server on your computer.
  2. su to postgres ('su -l postgres') and create a 'sakai' user. You do this by running the command 'createuser -P sakai'. You will be prompted for a password. I will refer to the sakai database username and password from hereon as 'SAKAI_DB_USER' and 'SAKAI_DB_PASSWORD' respectively. When asked if the sakai user needs to create databases and users, say no.
  3. Create the Sakai database. As the postgres user, run the command 'createdb -O SAKAI_DB_USER sakai'. This means 'create an empty database called sakai, and mark it as being owned by the user 'SAKAI_DB_USER'.

Configure Sakai Database

Sakai comes with a set of SQL scripts for building the Sakai database. Unfortunately, these are tuned for Oracle and thus need modifying before running across PostgreSQL.

  1. Change directory to 'SAKAI_SRC_DIR/deploy/src/sql/legacy'.
  2. Copy the entire oracle directory to a new directory called postgres, then change to that directory..
  3. Concatenate all the filed beginning with 'chef_' into one file called 'pg_all.sql'.
  4. Edit pg_all.sql and delete all the lines starting with 'DROP'.
  5. Replace all instances of 'VARCHAR2' with 'VARCHAR'.
  6. Replace 'BODY LONG RAW' with 'BODY BYTEA'.
  7. Replace 'SESSION_USER' with '"SESSION_USER"'. This is a reserved word in PostgreSQL so it has to be wrapped in double quotes for the database server to accept it.
  8. Switch user to postgres ('su -l postgres') and create the sakai tables by running 'psql -U SAKAI_DB_USER SAKAI $<$ pg_all.sql'.

Build and Deploy Sakai

  1. Copy the directory 'SAKAI_SRC_DIR/deploy/src/usr_local_sakai' to '/usr/local/sakai'.
  2. Change directory to '/usr/local/sakai'.
  3. For each directory 'sakai-component', 'legacy-component', and 'framework-component', change to the directory, delete 'components.xml' and then rename 'components_db.xml' to 'components.xml'.
  4. Change directory back to '/usr/local/sakai' and edit 'sakai.properties'.
  5. Locate the lines specifying the Oracle database parameters and cut and paste them back into the document. Change the 'sql.driver' entry so that it reads 'sql.driver=org.postgresql.Driver'. Change the 'sql.connect' entry so that it reads 'sql.connect=jdbc:postgresql://localhost:5432/SAKAI'. Change the 'sql.user' entry so that it reads 'sql.user=SAKAI_DB_USER' (remember, SAKAI_DB_USER refers to the PostgreSQL user that owns the sakai database). Change the 'sql.pw' entry, so that it reads 'sql.pw=SAKAI_DB_PASSWORD'.
  6. Change directory to 'legacy-component' and edit 'components.xml'. Wherever there is a property named 'locksInDb', change the value from true to false.
  7. In the directory
    'SAKAI_SRC_DIR/legacy-component/src/java/org/sakaiproject/component/legacy/id' edit 'ClusterIdService.java', replacing 'CHEF_ID_SEQ.NEXTVAL from dual' with 'nextval('CHEF_ID_SEQ')'.
  8. In the directory
    'SAKAI_SRC_DIR/legacy-component/src/java/org/sakaiproject/component/legacy/event' edit 'ClusterEventTracking.java', replacing 'CHEF_EVENT_SEQ.NEXTVAL from dual' with
    'nextval('CHEF_EVENT_SEQ')'.
  9. In the directory
    'SAKAI_SRC_DIR/framework-component/src/java/org/sakaiproject/component/framework/session' edit 'ClusterUsageSessionService.java', replacing 'SESSION_USER' with '$\backslash$"SESSION_USER$\backslash$"'. SESSION_USER is a reserved word in PostgreSQL (unlike Oracle) and thus needs to be enclosed in escaped double quotes.
  10. Setup the 'build.properties' file up in your home directory, as per the instructions at the sakai download site. The 'maven.repo.remote' entry can be modified to add another repository and thus speed project building. I added 'http://mirrors.sunsite.dk/maven' to the comma separated list of repositories.
  11. Change to SAKAI_SRC_DIR and type 'maven'. Sakai should compile and a set of web applications will be installed into Tomcat. You should now be able to go to the URL 'http://localhost:8080/sakai-uPortal' and log in as 'admin' with password'admin'. You obviously need to change this as soon as possible!

Differences with Sakai RC2 Installation

The current public release is Sakai 1.0 RC2 (Release Candidate 2). The software can be downloaded from http://cvs.sakaiproject.org/release/1.0.rc2/. The Sakai software was installed on a Linux machine, trent.dl.ac.uk, running operating system Redhat WS release 3. The Sakai RC2 portal can be seen at http://trent.dl.ac.uk:8080/portal. The build and deployment of Sakai portal was based using the following software.

The current Sakai release only supports the MySQL and Oracle databases. Some changes were made to the Sakai source in order to make it work with the PostgreSQL database.

The instructions for setting up the build environment and configuration files can be found in [84].

Sakai looks in files on the server to get configured in /usr/local/sakai.

PostgreSQL Setup

Install and setup a database for Sakai use according to PostgreSQL instructions, making sure the file pg_hba.conf is correctly setup for database access.

Database changes:

Edit the file which stores the session information in the database,
/usr/local/sakai-dev/deploy/src/sql/legacy/oracle/chef_session.sql. The variable SESSION_USER is reserved in PostgreSQL. The word SESSION_USER should be placed in quotes, ie "SESSION_USER".

Change the following Oracle specific syntax to PostgreSQL syntax in
/usr/local/sakai-dev/deploy/src/sql/legacy/oracle/chef_*.sql,

Populate the Sakai database with default information by running the file
/usr/local/sakai-dev/deploy/src/sql/legacy/oracle/all.sql script.

Modify file in /usr/local/sakai/legacy-component/components.xml and change locksInDb to false.

To work with PostgreSQL database, the file in /usr/local/sakai.properties needs to be modified to add the database driver settings as follows,

sql.driver=org.postgresql.Driver
sql.connect=jdbc:postgresql://localhost/<sakaiDB>
sql.user=<sakai>
sql.pw=<sakai>

Code changes:

Change all reference to SESSION_USER to SESSION_USERïn java file ClusterUsageSessionService.java.

Some of the SQL syntax is specific to Oracle and therefore requires changes in the Java source as follows. Note the location of source files is in $SAKAI-DEV/ where $SAKAI-DEV is the directory path of Sakai installation.

The PostgreSQL JDBC jar file needs to be copied to $CATALINA_HOME/common/lib.

Installation using CVS Version

Note Sakai RC2 was released with JavaServer Faces integration somewhat broken. A much improved source was obtained from the current CVS to do the Technology Portability Profile (TPP) tool development using JSF. The CVS version consists of on going development work to the Sakai framework and hence the software should be considered with some risks, as the enhancements or new features will not have been tested fully.

The above changes to PostgreSQL apply when using the CVS version to set up the Sakai portal.



Subsections
next up previous contents
Next: Add Users Up: SAKAI EVALUATION EXERCISE (A Previous: Evaluate new Work   Contents
Rob Allan 2005-05-09