Install Guide - Binary Install (2.6)

Sakai Binary Distribution Installation Guide

1.0 Verify/Install Java 5.0

Sun Microsystem's Java 2 Platform Standard Edition 5.0 (J2SE 5.0), a.k.a Java 1.5, remains the recommended JVM to build and run Sakai. Certain files, such as *.jsp and *.jws, require compilation so downloading and attempting to use only the runtime environment (JRE 5.0) will not suffice.  Mac OS X includes the full version of Java J2SE 5.0, pre-installed with the Java Development Kit (JDK) and the HotSpot virtual machine (VM), so Mac users should not need to install Java.  If you find Sun's version and naming conventions confusing, see Sun Java SE Naming and Versions for an outline of their practices.

(minus) Oracle's Sun Java J2SE 5.0 (a.k.a Java 1.5) has completed the EOL process and is no longer supported. If are still running Java 1.5 please note that security vulnerabilities exist in JDK/JRE 5.0 updates 1.5.0_17 and earlier. Sun recommends that you install JDK/JRE 5.0 Update 18+ (the final update is JDK/JRE 5.0 Update 22).

(warning) Sakai 2.6 can be run using Java Platform, Standard Edition 6 (Java SE 6), a.k.a Java 1.6, although to-date there is little production experience that warrants recommending 2.6 users to upgrade their JVM. Should you choose to run Sakai in a Java 6 JVM you must (at a minimum) add the following environment setting to your JAVA_OPTS:

-Dsun.lang.ClassLoader.allowArraySyntax=true

To confirm that Java is both installed on your system and is the correct version for Sakai, run java -version from the command line:

java -version

If Java is installed, basic version and build information will be displayed:

java version "1.5.0_18"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)
Java HotSpot(TM) Server VM (build 1.5.0_18-b02, mixed mode)

If Java is not installed or you are running the wrong version you can download the J2SE 5.0 JDK release from Sun's archive:

Install the SDK, typically in the /opt directory, i.e. /opt/java. Install the JRE in a different directory (usually the default directory, especially if running Windows) or you may experience run-time issues.

1.1 Set Java environment variables

Several environment variables and related properties must be set for Java. For UNIX operating systems one typically modifies a startup file like ~/.bash_login to set and export shell variables while Mac users typically set and export environment variables in .bash_profile. For Windows, go to Start -> Control Panel -> System -> Advanced -> Environment Variables and set JAVA_HOME via the GUI.

Set the JAVA_HOME environment variable to point to the base directory of your Java installation and add Java's /bin directory to the PATH environment variable.

(info) If the variable JRE_HOME is already set or if you want to use a particular JRE if you have more than one JRE installed on your machine then you'll want to set the JRE_HOME variable as well. JRE_HOME is what Apache Tomcat uses when it starts up, but it defaults to use JAVA_HOME if JRE_HOME is not set. In most cases, setting JAVA_HOME should cover both cases sufficiently.

Variable

Unix

Mac

Windows

JAVA_HOME

export JAVA_HOME=/usr/java/java-current

export JAVA_HOME=/Library/Java/Home

JAVA_HOME=C:\j2sdk1.5.0_18

PATH

export PATH=$PATH:$JAVA_HOME/bin/

export PATH=$PATH:$JAVA_HOME/bin/

;C:\jdk1.5.0_18\bin

(warning) Windows: append the string to the end of the Path system variable

Set JAVA_OPTS

The default Java virtual machine (JVM) settings are insufficient for an application of Sakai's size. As a result several JVM parameters must be increased for Sakai to run, while others may need to be adjusted for optimal performance. At a minimum add the following property settings to your JAVA_OPTS environment variable. We recommend that you define these settings in Tomcat's /bin directory in a file named setenv.sh (Unix/Mac) or setenv.bat (Windows). See the Tomcat section below for more details.

Unix/Mac:

export JAVA_OPTS='-server -XX:+UseParallelGC -Xmx768m -XX:MaxPermSize=128m -Djava.awt.headless=true -Dhttp.agent=Sakai -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false'

Windows:

set JAVA_OPTS=-server -XX:+UseParallelGC -Xmx768m -XX:MaxPermSize=160m -Djava.awt.headless=true -Dhttp.agent=Sakai -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false}}

(warning) Java 6 users must also add the following setting to their JAVA_OPTS:

-Dsun.lang.ClassLoader.allowArraySyntax=true

Specify a Language and Locale (optional)

You can define the default language/locale when starting Sakai by setting the system properties -Duser.language and -Duser.region. For information on supported languages see the release notes or visit the i18N Work Group space.

-Duser.language=pt 
-Duser.region=PT

Specify an HTTP Proxy (optional)

In environments where local network policy or firewalls require use of an upstream HTTP proxy/cache, Sakai needs to be configured accordingly. Otherwise components or services which use HTTP requests, such as the BasicNewsService for RSS feeds in the News tool, cannot retrieve data from the target URLs. This can be fixed with the following JAVA_OPTS arguments:

-Dhttp.proxyHost=cache.some.domain 
-Dhttp.proxyPort=8080

Tomcat 5.5.27+

Tomcat 5.5.27+ enforces strict quote escaping a change in *.jsp handling that have yet to be addressed in certain tools such as portfolios. The workaround requires adding this system property. See SAK-15736 - Getting issue details... STATUS .

-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

2.0 Install Tomcat 5.5.33

(info) Sakai installations should always be accompanied by a fresh install of Tomcat. It provides a clean environment that simplifies troubleshooting if problems are encountered during the startup phase.

(minus) Sakai 2.6 out-of-the box (OOTB) will not run inside Tomcat 6.0+.

The Apache Tomcat servlet container provides an ideal environment for running Sakai as a web application. Tomcat implements both the Java Servlet and JavaServer Pages (JSP) specifications and can be run in standalone mode or in conjunction with a web application server such as the Apache HTTP server or JBoss. Sakai 2.6 works with the Tomcat 5.5 series. We recommend Tomcat 5.5.33 in order to avoid certain Tomcat security vulnerabilities present in earlier releases. Note however, that using Tomcat 5.5.27+ requires the addition of a JAVA_OPTS parameter (see below). Sakai 2.6 is not compatible with Tomcat 6.0+.

Tomcat can be downloaded as a binary install from http://archive.apache.org/dist/tomcat/tomcat-5/

Choose the core distribution. Windows users have the option of downloading either a Windows Service Installer .exe or a binary *.zip archive. We recommend the *.zip archive over the installer because configuration and log viewing are easier. You can later convert the .zip install into a service install by running /bin/service.bat (see below for more details).

Unpack the Tomcat archive into your installation directory of choice, e.g. /opt/. Unix/Mac users should create a symbolic link (e.g., ln -s apache-tomcat-5.5.33) while Windows users should simply rename the base Tomcat directory to /tomcat to simplify the path.

Tomcat pathnames

Windows users should ensure that the Tomcat path includes no spaces as this causes errors with JavaServer Faces (JSF) tools in Sakai.

(thumbs up) Good: C:\opt\tomcat\, C:\sakaistuff\installs\tomcat\ (thumbs down) Bad: C:\program files\tomcat\, C:\opt\apache tomcat 5.5.33\

Tomcat permissions

Unix/Mac users should make sure that they have write permissions to the Tomcat servlet container files and directories before proceeding or startup permission errors may occur.

Tomcat 5.5.27+ and strict quote escaping

(minus) Tomcat 5.5.27+ enforces strict quote escaping which causes run-time errors in certain Sakai tools that use the JavaServer Faces (JSF) UI rendering framework. See https://issues.apache.org/bugzilla/show_bug.cgi?id=45015 for more details. If you deploy Sakai using Tomcat 5.5.27+ add the following parameter to your JAVA_OPTS environment setting:

-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

Tomcat JDK 1.4 Compatibility Package

(minus) Do not download and install the JDK 1.4 Compatibility Package. Sakai 2.6 will not run should you install it.

2.1 Set Tomcat environment variables

By convention, the base Tomcat directory (e.g. /usr/local/apache-tomcat-5.5.33) is referred to as $CATALINA_HOME. As a convenience, you should create a $CATALINA_HOME environment variable. For UNIX operating systems one typically modifies a startup file like ~/.bash_login to set and export shell variables while Mac users typically set and export environment variables in .bash_profile. For Windows, go to Start -> Control Panel -> System -> Advanced -> Environment Variables and set your Tomcat environment variables via the GUI.

Set the CATALINA_HOME environment variable to point to the base directory of your Tomcat installation and add the Tomcat /bin directory to your PATH variable:

Variable

Unix/Mac

Windows

CATALINA_HOME

export CATALINA_HOME=/opt/tomcat

CATALINA_HOME=C:\tomcat

PATH

export PATH=$PATH:$CATALINA_HOME/bin

;C:\tomcat\bin

(warning) Windows: append string to the end of the Path system variable.

2.2 Configure Tomcat

If you want to run Tomcat on different ports than the defaults, this would also be a good time to make those changes in the server.xml file. See Tomcat's configuration documentation for more details.

If you plan to run Tomcat as a standalone web server as opposed to running it in conjunction with the Apache HTTP server then you will want to make a further minor change that may spare some confusion later. The ROOT webapp is the one served up when a request is made to Tomcat's root URL. If you want users to be re-directed automatically to the Sakai application, you must insert an index.html file into /webapps/ROOT that prompts this re-direction. The index.html file should look something like the following:

<html>
<head>
<title>Redirecting to /portal</title>
<meta http-equiv="Refresh" content="0:URL=/portal">
</head>
<body bgcolor="#ffffff" onLoad="javascript:window.location='/portal';">
<div style="margin:18px;width:288px;background-color:#cccc99;padding:18px;border:thin solid #666600;text-align:justify">
<p style="margin-top:0px">
You are being redirected to the Sakai portal. If you are not automatically redirected, use the link below to continue:<br/>
<a href="/portal">Take me to the Sakai portal</a>
</p>
</body>
</html>

(warning) Neglecting this adjustment will force users to append /portal to the URL entered to access Sakai each time. If you intend to connect Tomcat with Apache HTTP server you can configure redirections from within Apache, an option that lies outside the scope of this document.

2.3 Tomcat memory management

You can better manage Tomcat memory usage by creating a setenv.sh/.bat file defining JAVA_OPTS environment variable settings in the tomcat/bin directory.

Mac/Unix: create a file called setenv.sh and add the following line:

export JAVA_OPTS='-server -XX:+UseParallelGC -Xmx768m -XX:MaxPermSize=160m -Djava.awt.headless=true'

Windows: create a file called setenv.bat and add the following line:

set JAVA_OPTS=-server -XX:+UseParallelGC -Xmx768m -XX:MaxPermSize=160m -Djava.awt.headless=true

2.4 Set up Tomcat as a Windows service

You can convert the .zip install into a service install by running service.bat from the /bin directory:

C:\tomcat\bin> service.bat install

You can add a service name as a second argument to the above script (the default name is "Tomcat5"). You can uninstall the service by replacing "install" with "remove".

After this you need to set the default startup options:

C:\tomcat\bin> tomcat5 //US//Tomcat5 ++JvmOptions "-Xms512m;-Xmx1024m;-XX:PermSize=128m;-XX:MaxPermSize=256m;-Dfile.encoding=UTF-8; -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"

If you choose to do this in the GUI follow these steps: Open the configuration window, issue the following command:

C:\tomcat\bin> tomcat5w //ES//Tomcat5

Replace "Tomcat5" with whatever service name you chose for the install. You'll want to set the service to startup automatically ("Startup Type" under the General tab).

Windows users that have installed Tomcat as a service can set most Java options through the Tomcat service manager GUI, but not all of them are as straightforward as inclusion in a single environment variable. To achieve the equivalent of the "-server" option, you'll need to change the Java Virtual Machine path from ..\bin\client\jvm.dll to ..\bin\server\jvm.dll.

(minus) Java 1.6 users will you need add the system property -Dsun.lang.ClassLoader.allowArraySyntax=true. This option is not required for Java 1.5. Please see the Java section above or SAK-15874 for more details.

Be sure to put the remaining JAVA_OPTS on separate lines in the Java Options field of the GUI, e.g.:

-Xms512m
-Xmx1024m
-XX:PermSize=128m
-XX:MaxPermSize=256m
-Dfile.encoding=UTF-8
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
-Dsun.lang.ClassLoader.allowArraySyntax=true
-Dhttp.agent=Sakai

(warning) Samoo has reported that display issues after editing text documents with accented characters using the resources tool. The issue was resolved by adding -Dfile.encoding=UTF-8 as a Java option (open command window -> type "tomcat5w" -> "Java" ->"Java Options:").

You can add additional system properties if needed, e.g., -Dsakai.security=C:\tomcat\security.

Finally, clear out the Initial Memory Pool and Maximum Memory Pool values, as those might conflict with the options you're putting in the Java Options field. Then click Apply, restart the service, and double-check the service manager to verify that the values have changed.

(warning) Java 1.6 users may encounter the unhelpful system log error "The Apache Tomcat service terminated with service-specific error 0 (0x0)". This can be fixed by copying the file msvcr71.dll from the /bin directory into the server or client directory with the jvm.dll file.

To set up remote debugging, please see (Remote Debugging).

3.0 Unpack the Sakai binary distribution

3.1 Configure Sakai

3.2 Default database support (HSQLDB)

4.0 Start/Stop Tomcat

5.0 Explore Sakai