| 2.1.2 Release Documentation The information below has been copied from the 2.1.2 release site, and is posted here for ongoing comment and correction. New content not present in the HTML guide on the release site appears in RED. |
4.1 Create sakai folder for properties files
Sakai runs with a default set of properties for its various components. To override them you'll want to specify them in a sakai.properties file which should be located in $CATALINA_HOME/sakai by default. This directory is not created by maven, so you'll have to do so manually. Once this directory is created, there are several *.properties files you can place inside which can override default properties.
| Choosing a different location for properties files You may find it advantageous to store sakai's configuration files outside of the Tomcat file structure. In a development environment, for example, you may find yourself frequently blowing Tomcat away, and you may wish to avoid recreating the sakai folder and its contained properties files each time. To accomplish this, you need only modify the java startup command (or the JAVA_OPTS environment variable) to set the system property sakai.home: -Dsakai.home=/path/to/desired/sakai/home/ You'll need to make sure that this location is readable and writable to Tomcat. |
4.2 The sakai.properties file
The main configuration file for Sakai is called sakai.properties, and you can either create it from scratch or copy in a known working copy. A sample sakai.properties file which self-documents many of the standard properties in its comments can be found in:
sakai-src/docs/sakai.properties
| Proposed addition The sakai.properties that the OOTB software uses as its default may be found in: sakai-src/kernel/component/src/config/org/sakaiproject/config/sakai.properties |
sakai.properties can define two different types of settings. The first type sets those values that are made available to the running code from the Sakai configuration service. A line of sakai.properties sets this sort of value if it has the form:
name=value
The second type of sakai.properties setting overrides the configuration defaults of individual sakai components. These defaults are initially set in the components.xml file of each particular component, but rather than modifying them there before a maven build, it's a best practice for all such customized settings to instead be overridden in sakai.properties. Override settings have the form:
name@component-name=value
New value settings can be freely added to the sakai.properties file, since any component property can in principle be overridden here, and so any sample sakai.properties will show only a small fraction of all the possible settings.
| Learning more about sakai.properties sakai.properties documentation: to find the most detailed documentation on the full variety of possible sakai.properties settings, look for sakai_properties.doc in docs/architecture of the source archive. A direct link to the documentation file in the 2-1-2 tag of subversion is below: |
4.3 Personalizing Sakai
Sakai has a number of places where your institution names, service names, and the host name of your service are used. These can be configured in sakai.properties:
# identify your application server with a short name, unique among the servers in your cluster. # choose a server id even if you are running a single app server serverId=localhost # the URL to the server, including transport, DNS name, and port, if any serverUrl=http://localhost:8080 # the DNS name of the server serverName=localhost # the URL to send folks to after they logout loggedOutUrl=http://localhost:8080/portal # some fill-ins for the css/vm ui (Worksite Setup, Digest Service, Email notification, Worksite Setup, Contact Support, Portal) ui.institution = Your Institution ui.service = SakaiOrWhatever #copyright text to appear in the bottom area of each web page. bottom.copyrighttext=(c) 2003, 2004, 2005 sakaiproject.org. All rights reserved. # links placed on the bottom nav - set the .count to the number of items, then add each item bottomnav.count = 2 bottomnav.1 = <a href="https://localhost/portal/site/!gateway">Gateway</a> bottomnav.2 = <a href="http://sakaiproject.org/cms" target="_blank">The Sakai Project</a>
You can add more or other links to the bottom navigation bar by setting the proper bottomnav.count value and adding bottomnav.N values (1 through the number of links).
| User Presence Enabled by Default User presence is on automatically in this release, although it has not been in recent releases. If you do not wish to use it at your institution, you must explicitly set its value to be false in sakai.properties: # to enable presence display in the portal display.users.present=true |
4.4 Email configuration
Sakai needs to be set up for two email functions: receiving email sent to Sakai sites, and sending out email notifications. For sending mail Sakai needs the address (name or IP) of an SMTP server that will accept mail from Sakai. This needs to be set in your sakai.properties file:
smtp@org.sakaiproject.service.framework.email.EmailService=some.smtp.org
To enable Sakai to receive mail there are a few settings needed in the sakai.properties file:
# dns addresses used for incoming email smtp.dns.1 = 255.255.255.1 smtp.dns.2 = 255.255.255.2 # SMTP port on which our SMTP server runs. Default is 25. #Recommend running on 8025, and using a standard mailer on 25 to forward mail to Sakai. smtp.port = 25 # flag to enable or disable our SMTP server for incoming email (true | false) smtp.enabled = true
To disable the SMTP server for incoming email, use this in sakai.properties:
smtp.enabled = false
Sakai's SMTP server is 'James,' and to run with the above configuration which runs James on the standard SMTP port 25 you must be running with admin privileges. Most production folks don't want to let Tomcat run with that, and would rather run a standard mailer like postfix on port 25 and configure it to forward requests to Sakai. You might also already have a mailer service running on port 25 (Linux usually has it running by default), and so you'd want to change the James port simply to avoid a conflict. You'll typically want to run James on another, non-restricted port, then. For example:
smtp.port = 8025
4.5 JVM Tuning
The Java virtual machine's configuration is very important to tune for best performance in any production environment, and some of Sakai's tools may not operate the memory alloted by the default JVM.
| Disclaimer JVM tuning is, as a general rule, something of a black art, and we recommend that you take the time to experiment with different memory and garbage collection settings and see what works best in your environment. We can make some minimal recommendations that should serve as a foundation for further experimentation and testing, but the following details are however offered only as samples or suggestions, and we recommend that you consult a systems administrator or local Java guru before making any such changes to a production system. See Sun's Tuning Garbage Collection documentation for more details. |
The standard way to control the JVM options when Tomcat starts up is to have an environment variable JAVA_OPTS defined with JVM startup options. Since any given Sakai instance may be deployed for a variety of purposes - ranging from developers doing private testing to large-scale deployments - it's hard to recommend a single set of such options as the preferred ones for every case. We can, however, start with a bare minimum which will at least avoid "Out of Memory" errors:
JAVA_OPTS="-server -Xmx512m -Xms512m -XX:PermSize=128m -XX:MaxPermSize=128m"
This is an adequate - if minimal - starting point: it selects server mode, sets an adequate heap size (we have found the best results when the min and max memory settings - Xms and Xmx, respectively - are set to be the same values), and sizes the permanent generation to accommodate more longer-persisting objects. These settings will allow things to be functional for testing, but will hardly be adequate for serving multiple concurrent users. A more suitable production environment on a 32-bit machine might use a set of options like:
JAVA_OPTS="-server -Xms1500m -Xmx1500m -XX:NewSize=400m -XX:MaxNewSize=400m -XX:PermSize=128m -XX:MaxPermSize=128m -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails"
This is better: a larger heap size is set for smoother performance, and garbage collection messages are turned on. Another important setting is the NewSize - what is important is the ratio of NewSize to the size of the heap. We want as large a NewSize as we can fit in the total heap, while keeping the total heap significantly bigger than NewSize in order for Java to properly garbage collect.
As you can see, there's a lot to think about here, and in practice each implementing institution uses their own particular JAVA_OPTS that they've settled on for their deployment and hardware; these typically use more option arguments than we've shown here. This discussion is meant only as a head start, and there is no replacement for doing your own testing.
In any event, once you set JAVA_OPTS Tomcat will see this environment variable upon startup and use it. Instead of putting this in an environment variable, you might modify the $CATALINA_HOME/bin/catalina.bat or $CATALINA_HOME/bin/catalina.sh file to automatically set these values during startup.
| JVM Tuning in Windows XP Windows users may set Java options in a "Tomcat Properties" dialog. But you may find that the permanent generation settings mentioned above will not work appropriately if set in the Java Options: field of the dialog window. That's because these settings have their own fields in the properties GUI, under the headings Initial Memory Pool and Maximum memory pool, respectively. Windows apparently ignores attempts to alter these values through the Java Options field. |
4.6 Test Sakai
At this stage your installation of Sakai has not yet been configured to use your preferred database (it will use its own HSQLDB by default), but you should now be able to bring it up as a working web application by simply starting Tomcat, and it can be helpful at this point to know if any problems exist before you try to connect it to another database. Tomcat will take a minute or so to start up, depending on the speed of your machine, and it's a good idea to watch the Tomcat log as it comes up to catch any errors (see Troubleshooting).
From $CATALINA_HOME you can start up Tomcat with the command:
| OS | Sample Output |
|---|---|
| Windows | start-sakai.bat |
| Mac/*nix | start-sakai.sh |
Once Tomcat has loaded the Sakai application (again, this can take a minute or so) point your browser to
If the gateway page does not come up, check the Tomcat logs (see the Troubleshooting section) for any errors and stack traces. If the gateway page does come up, log in with the default admin account:
- username : "admin"
- password : "admin"
If you can log in without errors you should be able to stop Tomcat and proceed with Database Configuration, if needed.
| OS | Sample Output |
|---|---|
| Windows | stop-sakai.bat |
| Mac/*nix | stop-sakai.sh |
Comments (7)
Apr 21, 2006
Clay Fenlason says:
Under Section 4.1 above, it shouldn't talk about "several .properties" files. Th...Under Section 4.1 above, it shouldn't talk about "several *.properties" files. That language dates back to the placeholder.properties era. Although clustering files like local.properties may still be valid, there's no need to hint at that possibility here.
Apr 27, 2006
Clay Fenlason says:
Remember, when you start running Sakai 2.2 with a sakai.properties file, as prev...Remember, when you start running Sakai 2.2 with a sakai.properties
file, as previously documented, you must update your properties
because of the new API names.
For example, this line:
vendor@org.sakaiproject.service.framework.sql.SqlService=oracle
needs to be:
vendor@org.sakaiproject.db.api.SqlService=oracle
because the SqlService API name is changed.
Pretty much any setting of the form
name@bean-id=value
needs to be checked and updated.
For the rest of the database settings:
javax.sql.DataSource
has not changed name, so lines like this:
driverClassName@javax.sql.DataSource=oracle.jdbc.driver.OracleDriver
url@javax.sql.DataSource=jdbc:oracle:thin:@blah.blah.blah
username@javax.sql.DataSource=xxx
password@javax.sql.DataSource=xxx
validationQuery@javax.sql.BaseDataSource=select 1 from DUAL
are ok.
May 18, 2006
Clay Fenlason says:
There should probably be a note suggesting that people not use an old sakai.prop...There should probably be a note suggesting that people not use an old sakai.properties file, but rather start with a fresh one.
May 03, 2006
Clay Fenlason says:
Section 4.3 really has more detail than is needed here, and it would be better t...Section 4.3 really has more detail than is needed here, and it would be better to simply refer to sakai.properties documentation for most of it. Focus on the essentials.
May 17, 2006
Clay Fenlason says:
Since the JVM tuning is now essential, this section should appear in "Set Up you...Since the JVM tuning is now essential, this section should appear in "Set Up your Build Environment"
May 17, 2006
Thomas Bartels says:
SS 4.2 the correct link for for the sakaiproperties.doc is: https://source.sakai...SS 4.2 the correct link for for the sakai_properties.doc is:
https://source.sakaiproject.org/svn/sakai/tags/sakai_2-1-2/docs/architecture/sakai_properties.doc
May 24, 2006
Clay Fenlason says:
Thanks, Thomas. I'll make sure all the links get updated for the new subversion ...Thanks, Thomas. I'll make sure all the links get updated for the new subversion organization with the 2.2 docs.