Original Sakai notes

These Sakai installation notes are obsolete, based on our attempts to install an older version of the software. They are being kept here for historical purposes only.

Contents:

1. Installing Sakai

These notes describe out installation of Sakai on Scientific Linux 4.02 (a Redhat enterprise clone).

We have decided not to use the quickstart install, instead following instructions per http://cvs.sakaiproject.org/release/1.5.0/index-dev.html.

The host we are using is sakai-vre-demo.oucs.oc.ac.uk.

1.1. File protections

Our first attempt at installtion ran into a couple of problems due to file protections. Tomcat was installed as root, with root owner/group for all the Tomcat directories. This caused problems when installing Sakai.

Our proposed approach is to install all Tomcat files under a new user tomcat, group tomcat, and make the Tomcat install files all group writeable. Then add group tomcat to the user used to install the Sakai software (sakaivre in our case. We have also declared all directories to carry the group sticky bit, so that new files are created with the same group ownetrship.

Everying inder $CATALINA_HOME/webapps needs to be changed to have group full access permission (g+rw).

We also want to ensure that Tomcat always runs as user tomcat.

1.2. Prerequisites

}}}

export MAVEN_HOME=/opt/maven-1.0.2 export PATH=$PATH:$MAVEN_HOME/bin }}}

useradd sakaivre }}}

maven.tomcat.home = /opt/apache-tomcat-5.5.16 ### Can use $CATALINA_HOME? }}}

}}}

}}}

1.3. Sakai installation

NOTE

}}}

Even with all this in place, Sakai startup was failing with access failure in directory /opt/sakai/sakai-dispatch - this directory had not been created, Why? This installation was leftb running for about a week, and when we came back to it we found about 500Mb of Tomcat logs, predominantly reporting SQL (no default pool) errors.

1.4. Sakai installation take 2

Coming back to this, we decided to restart from a clean installation of Tomcat, using user tomcat to perform the installation of both tomcat and sakaivre.

apache-tomcat-5.5.16-compat.tar.gz apache-tomcat-5.5.16-admin.tar.gz }}

./startup.sh }}}

/opt/maven-1.0.2/maven }}}

maven.tomcat.home = /opt/apache-tomcat-5.5.16 sakai.local.home = /opt/sakai }}}

}}}

(e.g. at http://www.ibiblio.org/maven2/commons-collections/commons-collections/3.0/commons-collections-3.0.jar), and copy it to /opt/apache-tomcat-5.5.16/shared/lib. Restart Tomcat. This time, it starts without errors.

1.5. Sakai installation take 3

Coming back to the installation created above, I've tried a couple of things:

maven.tomcat.home = /opt/apache-tomcat-5.5.16/ sakai.local.home = /opt/sakai/ }}}

export MAVEN_HOME=/opt/maven-1.0.2/ export CATALINA_HOME=/opt/apache-tomcat-5.5.16 }}}

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" onload="doLoad();">

</body>

</html> }}}

1.6. Sakai installation take 4

This attmept uses a pair of scripts to completely install and/or unistall the software.

### as root 
su -

#install java
yum install java


#create the user and group
useradd tomcat
usermod -G tomcat syeates
usermod -G tomcat zool0635

#create dircetories for the compnents we're going to install
for filename in /opt/maven /opt/sakai /opt/commons-logging /opt/logging-log4j /opt/apache-tomcat;
do
    mkdir -p $filename
    chown tomcat:tomcat $filename
done

ln -s  /opt/sakai/sakai-1.5.0 /usr/local/sakai 


### as tomcat
su - tomcat

#java is already installed
export JAVA_HOME=/usr/java/j2sdk1.4.2_10/

# install tomcat
cd /opt/apache-tomcat
wget http://apache.rmplc.co.uk/tomcat/tomcat-5/v5.5.16/bin/apache-tomcat-5.5.16.tar.gz
tar -xzf apache-tomcat-5.5.16.tar.gz
wget http://apache.rmplc.co.uk/tomcat/tomcat-5/v5.5.16/bin/apache-tomcat-5.5.16-compat.tar.gz
tar -xzf apache-tomcat-5.5.16-compat.tar.gz
wget http://apache.rmplc.co.uk/tomcat/tomcat-5/v5.5.16/bin/apache-tomcat-5.5.16-admin.tar.gz
tar -xzf apache-tomcat-5.5.16-admin.tar.gz

#rename the ROOT webapp, 
mv $CATALINA_HOME/webapps/ROOT $CATALINA_HOME/webapps/ROOT-OLD

#remember where we've kept it
export CATALINA_HOME=/opt/apache-tomcat/apache-tomcat-5.5.16/


# install maven
cd /opt/maven
wget http://www.mirror.ac.uk/mirror/ftp.apache.org/maven/binaries/maven-1.1-beta-2.tar.gz
tar -xzf maven-1.1-beta-2.tar.gz

# set some maven defualts in our home dircetory
cat > /home/tomcat/build.properties << EOF
maven.repo.remote = http://www.ibiblio.org/maven/,http://cvs.sakaiproject.org/maven/ 
sakai.local.home = /opt/sakai/sakai-1.5.0/
maven.tomcat.home = /opt/apache-tomcat/apache-tomcat-5.5.16
### Can use $CATALINA_HOME?
EOF

#remember whre we've kept it
export MAVEN_HOME=/opt/maven/maven-1.1-beta-2


# install sakai
cd /opt/sakai
wget http://cvs.sakaiproject.org/release/1.5.0/src/sakai-src.zip
unzip sakai-src.zip -d sakai-1.5.0

# run maven on sakai
cd /opt/sakai/sakai-1.5.0/
$MAVEN_HOME/bin/maven tomcat_context
$MAVEN_HOME/bin/maven reg
$MAVEN_HOME/bin/maven conf_db
$MAVEN_HOME/bin/maven 

The above fails in $MAVEN_HOME/bin/maven in legacy-component, because of a dependency problem. This can be fixed with the following patch:

[tomcat@sakai-vre-demo sakai-1.5.0]$ diff /opt/sakai/sakai-1.5.0/legacy-component/project.xml /opt/sakai/sakai-1.5.0/legacy-component/project.xml~
16,20d15
<                 <dependency>
<                         <groupId>xerces</groupId>
<                         <artifactId>xercesImpl</artifactId>
<                         <version>2.6.0</version>
<                 </dependency>

Which has the effect of adding the xerces jar to the class path. It turns out that SAKAI is refering to an internal xerces class (org.apache.xerces.impl.dv.util.Base64). With this patch it comiples and can be run with

$CATALINA_HOME/bin/startup.sh

That is is running can be verified by going to: http://sakai-vre-demo.oucs.ox.ac.uk:8080/sakai-portal/ and what we see is:

 Sakai : Varuna Portal Webapp

This is "index.html"

Portal /sakai-portal/varuna

Varuna Portal /sakai-portal/varuna.html 

The first error messages in the logs are:

Apr 24, 2006 4:14:44 PM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase /opt/apache-tomcat/apache-tomcat-5.5.16/webapps/sakai-portal inside the host appBase has
been specified, and will be ignored
Apr 24, 2006 4:14:44 PM org.apache.tomcat.util.digester.Digester startElement
SEVERE: Begin event threw exception
java.lang.ClassNotFoundException: org.sakaiproject.dav.DavRealm
        at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
        at java.security.AccessController.doPrivileged(Native Method)
...
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Apr 24, 2006 4:14:44 PM org.apache.catalina.startup.ContextConfig processContextConfig
SEVERE: Parse error in default web.xml
java.lang.ClassNotFoundException: org.sakaiproject.dav.DavRealm
        at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2725)
...

The script for removing these changes from the server is:

### as root 
su -

userdel tomcat
groupdel tomcat

mv /home/tomcat-old/ /home/tomcat/
mv /home/tomcat/ /home/tomcat-old/
mv /opt-old/ /opt 
mv /opt /opt-old/
rm -rf /usr/local/sakai

du -s /opt /opt-old/


yum remove java

1.7. Sakai installation take 5 SUCCESS!

1.7.1. Approach

After some advice from Adrian, we worked out that the root of the problem was that we were not using the latest version of Sakai (1.5 not 2.1.2). So we trid again, using a similar script to last time and it worked. As Adrian said, it should take less that 3 hours, if you're doing it right. The instructions I followed were the ones at: http://cvs.sakaiproject.org/release/2.1.2/InstallGuide.html for the source install.

Before the JACA_OPTS were set, the tomcat start up was taking ages and attempts to access port 8080 resulted in timeouts. In such a situation, the normal tomcat shutdown.sh script does not work, presumably because it too can't connect. Thus the "killall java" command.

### as root 
su -

#install java
yum install java

#create the user and group
useradd tomcat
usermod -G tomcat syeates
usermod -G tomcat zool0635

#create dircetories for the compnents we're going to install
for filename in /opt/maven /opt/sakai  /opt/apache-tomcat;
do
    mkdir -p $filename
    chown tomcat:tomcat $filename
done

### as tomcat
su - tomcat

#java is already installed
export JAVA_HOME=/usr/java/j2sdk1.4.2_10/


# install tomcat
cd /opt/apache-tomcat
wget http://apache.rmplc.co.uk/tomcat/tomcat-5/v5.5.16/bin/apache-tomcat-5.5.16.tar.gz
tar -xzf apache-tomcat-5.5.16.tar.gz
wget http://apache.rmplc.co.uk/tomcat/tomcat-5/v5.5.16/bin/apache-tomcat-5.5.16-compat.tar.gz
tar -xzf apache-tomcat-5.5.16-compat.tar.gz
wget http://apache.rmplc.co.uk/tomcat/tomcat-5/v5.5.16/bin/apache-tomcat-5.5.16-admin.tar.gz
tar -xzf apache-tomcat-5.5.16-admin.tar.gz


#remember where we've kept it
export CATALINA_HOME=/opt/apache-tomcat/apache-tomcat-5.5.16/

# we're not caring about non-roman characters to start with
#emacs  $CATALINA_HOME/conf/server.xml 


cat > $CATALINA_HOME/webapps/ROOT/index.html << EOF
<html>
<head>
  <meta http-equiv="refresh" content="0;url=/portal">
</head>
<body>
  redirecting to /portal ...
</body>
</html>
EOF

# install maven
cd /opt/maven
wget http://apache.mirror.positive-internet.com/maven/binaries/maven-1.0.2.tar.gz
tar -xzf maven-1.0.2.tar.gz

# set some maven defualts in our home dircetory
cat > /home/tomcat/build.properties << EOF
maven.repo.remote=http://source.sakaiproject.org/maven/
maven.tomcat.home = /opt/apache-tomcat/apache-tomcat-5.5.16/
EOF

#remember whre we've kept it
export MAVEN_HOME=/opt/maven/maven-1.0.2/

# install sakai
cd /opt/sakai

wget http://cvs.sakaiproject.org/release/2.1.2/sakai_2-1-2/sakai-src_2-1-2.tar.gz
tar -xzf sakai-src_2-1-2.tar.gz

# run maven on sakai
cd /opt/sakai/sakai-src
$MAVEN_HOME/bin/maven 
$MAVEN_HOME/bin/maven sakai
$MAVEN_HOME/bin/maven sakai:deploy

# this is sometimes needed because the normal shutdown times out / doesn't work when the JVM is very low on memory
killall java

# these are the recommended JAVA_OPTS from http://cvs.sakaiproject.org/release/2.1.2/postconfig.html#jvm
JAVA_OPTS="-server -Xms1500m -Xmx1500m -XX:NewSize=400m -XX:MaxNewSize=400m -XX:PermSize=128m -XX:MaxPermSize=128m -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails" $CATALINA_HOME/bin/startup.sh
$CATALINA_HOME/bin/shutdown.sh

The resulting page looks like:

http://www.flickr.com/photos/stuartyeates/135327822/

The install uses quite a bit of space:

243136  /opt/apache-tomcat
13648   /opt/maven
402212  /opt/sakai
149644  /home/tomcat/

The size of /home/tomcat/ is due to the presence of the maven repository, which a cache of all the libraries that maven has downloaded from the web.

Sakai 2.1.2 does a number of things better than 1.5, and a number of our earlier criticisms are no longer valid.

1.8. Notes

We think the following are broken or questionable. This is work-in-progress, so our views may change as we get on further with Sakai.


-- GrahamKlyne 2006-02-10 15:01:32

Creative Commons License
The content of this wiki is licensed under the Creative Commons Attribution-ShareAlike 2.0 England & Wales Licence.

OSS Watch is funded by the Joint Information Systems Committee (JISC) and is situated within the Research Technologies Service (RTS) of the University of Oxford.