Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1.0 Sakai 22 pre-requisites

To begin with the following items must be installed (you may skip any you all ready have installed.

1.0 Sakai 22 pre-requisites

To begin with the following items must be installed (you may skip any you all ready have installed).

  1. Java 11
  2. GIT
  3. Apache Maven 3.8 or later
  4. Apache Tomcat 9

...

The latest Sakai binary archive is available at http://source.sakaiproject.org/release/.


3.0 Verify/Install Java

...

11


Oracle's Sun Java SE 8JDK 11, a.k.a Java 1.811, is the required version to use with the Sakai. Certain files, such as *.jsp and *.jws, require compilation so downloading and attempting to use only the run time environment (JRE 8.0) will not suffice.  to use with Sakai 22.

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

...

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

java version "111.0.816.0_1111" 2022-08-18 LTS
Java(TM) SE Runtime Environment 18.9 (build 111.0.8.0_31-b13) 16.1+1-LTS-1)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 25.31-b0711.0.16.1+1-LTS-1, mixed mode)


3.1 Set Java environment variables

...

(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:\jdk1.8.0_31

...

PATH

...

export PATH=$PATH:$JAVA_HOME/bin

...

export PATH=$PATH:$JAVA_HOME/bin

...

;C:\jdk1.8.0_31\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.

(tick) 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 "Install Tomcat 8" section below for more details. 

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

In the case your locale is not fully supported in Java (as it happens with Basque or Mongolian languages) you should read this information:
Endorsed I18n Project 

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

4.0 Install Tomcat 8 

  • Apache Tomcat - http://tomcat.apache.org/
  • Note: Always do a fresh install of Tomcat 8
  • Note: For Sakai versions prior to 11.4 please use Tomcat 8.0.34 or earlier. Later versions of Tomcat may cause problems. example: Image RemovedSAK-31608 - Sakai has startup warnings on Tomcat 8.0.39+ CLOSED
  • Note: Windows users should ensure that there are no spaces in the complete tomcat path as this causes errors with JSF tools in Sakai
    GOOD: C:\opt\tomcat\, C:\sakaistuff\installs\tomcat\
    BAD: C:\program files\tomcat\, C:\opt\apache tomcat 8.0.43\

...

Windows users should get the zip file instead of installing a service
It makes viewing the tomcat logs easier and it is easier to configure

...

Example (assuming you have saved the file as /opt/apache-tomcat-8.0.x.tar.gz)

cd /opt
tar xzvf apache-tomcat-8.0.x.tar.gz
ln -nsf apache-tomcat-8.0.x tomcat

Windows users should either rename the directory or, if comfortable, create a directory junction using an elevated cmd prompt:

mklink /J C:\apache-tomcat-8.0.x C:\tomcat

...

  1. Add URIEncoding="UTF-8" to the Connector element
    • <Connector port="8080" URIEncoding="UTF-8" ...

...

Setup the SETENV file in the tomcat/bin directory with JAVA_OPTS (from Install Java 1.8).

Populate Database With Demo Data

Instead of starting with an empty database you can add the flag -Dsakai.demo=true in addition to the others shown here. During your first Tomcat launch it will populate your database with test data (students, courses, etc). Once the data has been created remove this flag for subsequent Tomcat launches. Be advised that this flag will not trigger on a database with data already in it so you must make this choice during the initial setup. It should also be noted that without this flag one will not be able to create any course sites in Sakai unless Academic Term, Subject, Course, and Section data is manually added to the "cm_" tables in the database.

We recommend using -Djava.util.Arrays.useLegacyMergeSort=true until this issue can be resolved -  Image RemovedSAK-31707 - Broken Equality Comparators in Gradebook RESOLVED

Mac/Linux: Create a file called setenv.sh with the following (alternately, you can put this into your .bashrc file so they're automatically executed):
Tomcat 8 Mac/Linux

export JAVA_OPTS="-server -d64 -Xms1g -Xmx2g -Djava.awt.headless=true -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC"
JAVA_OPTS="$JAVA_OPTS -Dhttp.agent=Sakai"
JAVA_OPTS="$JAVA_OPTS -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"
JAVA_OPTS="$JAVA_OPTS -Dsakai.security=$CATALINA_HOME/sakai/"
JAVA_OPTS="$JAVA_OPTS -Duser.timezone=US/Eastern"
JAVA_OPTS="$JAVA_OPTS -Dsakai.cookieName=SAKAI2SESSIONID"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8089 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

Windows(PC): Create a file called setenv.bat with the following:
Tomcat 8 Windows

...

.

Variable

Unix

Mac

Windows

JAVA_HOME

export JAVA_HOME=/usr/java/java-current

export JAVA_HOME=/Library/Java/Home

JAVA_HOME=C:\opt\java11

PATH

export PATH=$PATH:$JAVA_HOME/bin

export PATH=$PATH:$JAVA_HOME/bin

;C:\opt\java11\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.

(tick) 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 "Install Tomcat 9" section below for more details. 

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=es 
-Duser.region=ES

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

4.0 Install Tomcat 9 

  • Apache Tomcat - https://tomcat.apache.org/download-90.cgi
  • Note: Always do a fresh install of Tomcat 11
  • Note: Windows users should ensure that there are no spaces in the complete tomcat path as this causes errors with JSF tools in Sakai
    GOOD: C:\opt\tomcat\, C:\sakaistuff\installs\tomcat\
    BAD: C:\program files\tomcat\, C:\opt\apache tomcat 9.0.71\
  1. Download Tomcat 9 - https://tomcat.apache.org/download-90.cgi

    • Windows users could install the tomcat9 service, it makes viewing the tomcat logs easier and it is easier to configure.


  2. Extract to /opt (symlink the apache-tomcat-9.0.x directory to tomcat after extracting)
    • Example (assuming you have saved the file as /opt/apache-tomcat-9.0.x.tar.gz)

      cd /opt
      tar xzvf apache-tomcat-9.0.x.tar.gz
      ln -nsf apache-tomcat-9.0.x tomcat


    • Windows users should either rename the directory or, if comfortable, create a directory junction using an elevated cmd prompt:

      mklink /J C:\apache-tomcat-9.0.x C:\tomcat


  3. Modify conf/server.xml for international character support
    1. Add URIEncoding="UTF-8" to the Connector element
      • <Connector port="8080" URIEncoding="UTF-8" ...
  4. Set environment variable: CATALINA_HOME=/opt/tomcat
  5. Add $CATALINA_HOME/bin to PATH
  6. Setup the SETENV file in the tomcat/bin directory with JAVA_OPTS.

    Populate Database With Demo Data

    Instead of starting with an empty database you can add the flag -Dsakai.demo=true in addition to the others shown here. During your first Tomcat launch it will populate your database with test data (students, courses, etc). Once the data has been created remove this flag for subsequent Tomcat launches. Be advised that this flag will not trigger on a database with data already in it so you must make this choice during the initial setup. It should also be noted that without this flag one will not be able to create any course sites in Sakai unless Academic Term, Subject, Course, and Section data is manually added to the "cm_" tables in the database.

    We recommend using -Djava.util.Arrays.useLegacyMergeSort=true until this issue can be resolved -  Image AddedSAK-31707 - Broken Equality Comparators in Gradebook RESOLVED


    1. Mac/Linux: Create a file called setenv.sh with the following (alternately, you can put this into your .bashrc file so they're automatically executed):
      Tomcat 9 Mac/Linux

      export JAVA_OPTS="-server -d64 -Xms1g -Xmx2g -Djava.awt.headless=true -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC"
      JAVA_OPTS="$JAVA_OPTS -Dhttp.agent=Sakai"
      JAVA_OPTS="$JAVA_OPTS -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Djava.awt.headless=true -Dcom.sun.management.jmxremote -Dhttp.agent=Sakai -Djava.util.Arrays.useLegacyMergeSort=true -Dfile.encoding=UTF8

  7. [OPTIONAL] Delete the default webapps from the webapps dir

    rm -rf webapps/*
    
Improve startup speed

You can improve startup speed under Tomcat 8 significantly.

For Sakai 12 and earlier: Edit the file conf/context.xml and add this JarScanFilter block to the <Context>

       <JarScanner>
        <!-- This is to speedup startup so that tomcat doesn't scan as much -->
        <JarScanFilter defaultPluggabilityScan="false"
defaultTldScan="false"
tldScan="jsf-impl-*.jar,jsf-widgets-*.jar,myfaces-impl-*.jar,pluto-taglib-*.jar,sakai-sections-app-util-*.jar,spring-webmvc-*.jar,standard-*.jar,tomahawk*.jar,tomahawk-*.jar"/>
    </JarScanner>

 

...

    1. ESCAPING=false"
      JAVA_OPTS="$JAVA_OPTS -Dsakai.security=$CATALINA_HOME/sakai/"
      JAVA_OPTS="$JAVA_OPTS -Duser.timezone=US/Eastern"
      JAVA_OPTS="$JAVA_OPTS -Dsakai.cookieName=SAKAI2SESSIONID"
      JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8089 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"


    2. Windows(PC): Create a file called setenv.bat with the following:
      Tomcat 9 Windows

      set JAVA_OPTS=-server -Xmx1028m -XX:MaxMetaspaceSize=512m -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Djava.awt.headless=true -Dcom.sun.management.jmxremote -Dhttp.agent=Sakai -Djava.util.Arrays.useLegacyMergeSort=true -Dfile.encoding=UTF8


  1. [OPTIONAL] Delete the default webapps from the webapps dir

    rm -rf webapps/*
    
Improve startup speed

You can improve startup speed under Tomcat 9 significantly.

<JarScanner>
    <!-- This is to speedup startup so that tomcat doesn't scan as much -->
    <JarScanFilter defaultPluggabilityScan="false" />
</JarScanner>

...

If you need to override the default settings you must create your own sakai.properties file either from scratch or from a known working copy adding new key/value settings in order to customize your installation. We recommend that you review the default.sakai.properties file included in the source installation or in the appropriate maintenance branch.

The default location for your local sakai.properties file is $CATALINA_HOME/sakai. This folder is not created by Maven during the build and deployment process, so you will have to create it manually or via a script. You can also store Sakai's configuration files outside of your web application server's file hierarchy. For example, in a development environment you may find yourself frequently reinstalling Tomcat and unless you create a build script to automate the Tomcat installation and configuration process avoiding having to recreate $CATALINA_HOME/sakai and sakai.properties each time has its advantages.

...

-Dsakai.home=/path/to/desired/sakai/home/


5.2 Configure Database

Sakai 11 22 database support details

Make sure to include a MySql MySQL connector jar in your CATALINA_HOME/lib. 

...