1.0 Install Prerequisites
- Java 1.8
- Maven 3.0 or later
- Tomcat 8
Sakai 12.0 was QA tested with Java 1.8.0_111, maven-3-2.5 (though maven-3.3.9 should also work), Apache Tomcat 8.5.28
1.1 Verify/Install Java 1.8
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:
1.1.1 Set Java environment variables
~/.bash_loginto 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 Variablesand set
JAVA_HOMEvia 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.
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.
Windows: append the string to the end of the
Path system variable
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.
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.region. For information on supported languages see the release notes or visit the i18N Work Group space.
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
1.2 Install Git and/or local Github client
1.3 Install Maven 3
It is recommended to use Maven 3.2.5 through 3.3.9.
You can download Maven at
Extract the distribution archive into your installation directory of choice, e.g.
/usr/local/apache-maven-3.2.2. Confirm that you have installed the correct version of Maven and can start it by issuing
mvn --version from the terminal. At this point your environment is prepared to build and deploy the Sakai source code.
1.3.1 Set Maven environment variables
.bash_profile. For Windows, go to
Start -> Control Panel -> System -> Advanced -> Environment Variablesand set your Maven environment variables via the GUI.
MAVEN_HOME environment variable to point to the base directory of your Maven installation and add the Maven
/bin directory to your
Windows: append string to the end of the
Path system variable
Maven does not read
JAVA_OPTS on start up, resulting occasionally in "Out of Memory" errors when building Sakai. To assure sufficient memory allocation during builds, you should add a
MAVEN_OPTS environment variable as defined below. 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
MAVEN_OPTS via the GUI.
1.4 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: - SAK-31608Getting issue details... STATUS
- 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\
- Download Tomcat 8 - https://tomcat.apache.org/download-80.cgi
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
- Extract to /opt (symlink the apache-tomcat-8.0.x directory to tomcat after extracting)
Example (assuming you have saved the file as /opt/apache-tomcat-8.0.x.tar.gz)
Windows users should either rename the directory or, if comfortable, create a directory junction using an elevated cmd prompt:
- Modify conf/server.xml for international character support
- Add URIEncoding="UTF-8" to the Connector element
- <Connector port="8080" URIEncoding="UTF-8" ...
- Add URIEncoding="UTF-8" to the Connector element
- Set environment variable: CATALINA_HOME=/opt/tomcat
- Add $CATALINA_HOME/bin to PATH
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.
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):
Windows(PC): Create a file called setenv.bat with the following:
[OPTIONAL] Delete the default webapps from the webapps dir
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>
For Sakai 19 and later: After the JSF 2.3 migration, users may update the tomcat configuration to this one:
2.0 Get the Sakai source code
the master branch; stable releases can be found in
tagswhile maintenance and other work is performed in a 11.x branch.
11 release tag
To checkout a stable release tag, clone the git repo and then checkout the tag (in this case 11.0):
11.x maintenance branch
The latest bug fixes for a particular release can be found in our maintenance branches. Please note that certain maintenance branch fixes require database schema changes. You can check out the maintenance branch by issuing the following command from the terminal:
If you all ready have cloned the repository, skip step the clone step above.
3.0 Configure Sakai
1.0 Create a
sakai.propertiesfile is a central configuration file that is typically stored in a
/sakaisubdirectory relative to the Tomcat home directory (
$CATALINA_HOME). It is a non-XML text file containing a series of key/value pairs that is read using the load method of java.util.properties. Settings in
sakai.propertiesgovern everything from setting your institution's name to configuring your database. All settings in
sakai.propertiesare read on startup; any changes you make subsequently will only take effect when you restart web application server. You may want to create a local.properties file in the same directory as sakai.properties. Properties listed in local.properties override sakai.properties.
For a source installation the default
default.sakai.properties file is located in the
The bin package does not include a
sakai.properties file. This is a deliberate exclusion; it eliminates the possibility of overwriting a local
sakai.properties file if a bin package is opened over an existing Sakai installation.
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
sakai.properties each time has its advantages.
To locate your properties file outside of your web application server environment modify the Java startup command or the
JAVA_OPTS environment variable and set a system property named
sakai.home. Make sure your external location is readable and writable by your web application server.
sakai.propertiessettings, see the
2.0 Configure home page tool set per site
wsetup.home.toolids.*property is not set, the Worksite setup tool will default to the following set of tools for the home page:
sakai.synoptic.messagecenter. Synoptic tools will be added or dropped from home page depending on whether their linked tool exists in the site or not. See - SAK-15504Getting issue details... STATUS and - SAK-16747Getting issue details... STATUS for more details.
3.0 Work site setup group helper
4.0 Session timeout warning
loggedOutUrlsakai property. See - SAK-13987Getting issue details... STATUS - SAK-8152Getting issue details... STATUS for more details.
To enable the session timeout warning, set the following properties in your local
sakai.properties with a time interval of your choosing:
5.0 Configure email
sakai.properties. In order to send mail Sakai requires the address (name or IP) of an external SMTP server that will accept mail from Sakai:
Sakai's SMTP server is Apache James for Sakai 10 and earlier and SubEthaSMTP from 11. Most sys admins prefer running a standard mailer like Postfix on port 25 and configuring it to forward requests to Sakai. You may also currently have a mailer service running on port 25 (Linux usually has it running by default). So consider setting Sakai's SMTP service to run on a different port (e.g., 8025) in order to avoid conflicts.
To enable Sakai to receive mail you'll need to set the following properties:
Additional settings can be enabled to add support emails for a variety of tasks.
6.0 Configure logging
WARN:messages. There are going to be some "normal" ones at startup, and some will likely slip by at runtime, but any warning is potentially something you might want to check out.
Logging levels can be specified in
sakai.properties. This augments and overrides the levels set in the default config file. Example:
This uses the established (if awkward) method of having a
name.count followed by
name.2 etc. to form an array of strings for the value "name". In this case, the name is "log.config". The values are of the form
LEVEL.logger, and the possible levels are:
OFF TRACE DEBUG INFO WARN ERROR FATAL ALL.
Sakai uses log4j for logging. See the official log4j documentation for more information about how to configure it if you have questions, but a few notes are collected here below.
To change the logging for Sakai in the source modify
kernel/kernel-common/src/main/config/log4j.properties the following property:
To turn on debug logging for all of Sakai, change the value from INFO to DEBUG. In order to enable debug logging for a single Sakai components, add a line such as in the following example, which will leave most of Sakai at INFO, but generate DEBUG level messages for the SQL service:
The logging controls are part of the LogConfigurationManager, implemented as a component in the Kernel. It can be disabled, if that's desired, with an entry in
For Mac and *nix systems, the most important log is found in Tomcat's
logs/catalina.out. It can be instructive to watch this log as Tomcat is starting up, by using a startup command like the following:
Tomcat on Windows tends to be a little more puzzling about its logs, and it includes more of them, but its default behavior is to open
catalina.out in a new window as soon as you start Tomcat. If you need more information about the logs in Windows, we'll refer you to the official Tomcat documentation.
The SMTP server logs from Sakai will be written to the $CATALINA_HOME/sakai/logs directory.
7.0 Managing temporary files
Depending on usage, Sakai may create many large temporary files in the system temporary file storage location (e.g. /tmp). It is a good practice to routinely remove temporary files older than a day, especially if you have a lot of users or have heavy usage of mail sending with attachments. Note that you should not simply remove all temp files on a schedule as some of them may be in active use (also be careful about removing temp files which are used by other processes).
3.1 Configure database
Make sure to include a MySql connector jar in your CATALINA_HOME/lib.
Create a Sakai database with a default character set of UTF-8. Create a user account to which you will assign all permissions.
Use any database name and username you wish and then update your sakai.properties file (or even better, create a local.properties file, which has precedence).
In the example below the database is named "sakaidatabase" and the user account is "sakaiuser".
Excerpt from sakai.properties
## MySQL settings
4.0 Build, deploy and start up Sakai in Tomcat
Install the Sakai master project
Sakai makes use of Maven's Project Object Model to provide an XML representation of basic project information covering dependency management, build targets, external repositories, issue tracking, mailing lists, reporting plugins, developer bios, etc. A top-level master pom.xml file located in the
/master project acts as a parent for other Sakai pom.xml files. If you are building Sakai for the first time you should install the master project first by issuing the
install goals from the
/master project folder.
Install and deploy Sakai
Once you have built the master pom, issue the following Maven goals from the top-level Sakai source directory:
-Dmaven.tomcat.home specifies Tomcat's location. -Dsakai.home specifies the location of the sakai properties file(s) within Tomcat. -Djava.net.preferIPv4Stack can help resolve issues with Maven hanging while attempting to pull from certain repositories. These can be omitted if specified in Maven's
settings.xml file (version 2.x) or in MAVEN_OPTS (version 3.x).
Your first Sakai build will take some time as Maven downloads and stocks your local
.m2/repository with missing dependencies while performing the build and deploying
.jar files to Tomcat's
$CATALINA_HOME/shared/lib folders. If during this process Maven reports that the build failed read the accompanying error message carefully to troubleshoot the issue (see the Troubleshooting section).
You can also issue
mvn clean install sakai:deploy from any sakai project module top-level folder in order to build and deploy portions of Sakai such as individual tools.
Maven Goal Options
There are a number of other ways to build and deploy Sakai using Maven:
Print debug output
Build and Deploy in offline mode
If your local repository contains all Sakai project dependencies, you can run Maven "offline" by adding the
Skip unit tests
There may be occasions when you want to build and deploy Sakai without executing the set of unit tests that accompany many of the Sakai modules. If so add
-Dmaven.test.skip=true to the goals you issue:
Perform a "framework" build
The framework build profile triggers a Sakai build minus it's tool set.
The -Pframework build profile is no longer supported in Sakai 10.x versions.
Perform a "cafe" build
The programmers' cafe build profile is favored by many developers new to Sakai as well as those developing or testing new capabilities.
The -Pcafe build profile is no longer supported in Sakai 10.x versions.
4.1 Start/Stop Tomcat