Installation Guide

Table of Contents

1. Requirements

  • JDK 1.5+ installed (required for compilation and runtime)
  • For MAVEN 1 deployments only: the following must be manually added to local maven repository:
    • Manually copy Ajax4JSF 1.1.1 to local Maven repository:
      • copy from {sitestats_src}/lib/ajax4jsf-1.1.1.jar to ~/.maven/repository/org.ajax4jsf/jars/
    • Manually copy xmlgraphics-commons 1.1 to local Maven repository:
      • copy from {sitestats_src}/lib/xmlgraphics-commons-1.1.jar to ~/.maven/repository/org.apache.xmlgraphics/jars/

2. Installation (offline)

  1. Download source code from Subversion to your Sakai source directory (be sure to pick the most recent tag/branch - see main page):
    svn co https://source.sakaiproject.org/contrib//ufp/sitestats/tags/a_sitestats_tag/ sitestats
  2. Change your current directory to the recently downloaded folder
    cd sitestats
  3. Edit pom.xml file and change the version tag to reflect sakai version
  4. Run Maven to compile SiteStats (replace {tomcat_folder} with the path to your tomcat folder):
    • For sakai <= 2.4.x, use Maven 1:
      • maven -Dmaven.tomcat.home={tomcat_folder} sakai
    • For sakai >= 2.5 or trunk, use Maven 2:
      • mvn -Dmaven.tomcat.home={tomcat_folder} clean install sakai:deploy
  5. Make sure there are no multiple versions of sitestats jars in {tomcat_folder/shared/lib} (named sakai-sitestats-*.jar)

2.1. External database

For using an external database with SiteStats (recommended), the database must be previously created before starting sakai.

  1. Create the database. MySQL, Oracle and HsqlDB are officially supported (may work on other dbs as well). As an example, this a typical procedure for MySQL table creation:
    1. create database sitestats default character set utf8;
    2. grant all on sitestats.* to sakaiuser@'localhost' identified by 'sakaipassword';
    3. grant all on sitestats.* to sakaiuser@'127.0.0.1' identified by 'sakaipassword';
    4. grant all on sitestats.* to sakaiuser@'some.other.server.ip' identified by 'sakaipassword';
  2. Follow this section for related configuration details.

3. Upgrading from previous releases (offline)

  • If upgrading from previous releases, you may need to execute some sql script placed at \sitestats_src\updating folder.
  • Also, make sure to delete the previous API jar named {tomcat_folder}/shared/lib/sakai-sitestats-*.jar

4. Tomcat configuration

Please make sure you add -Djava.awt.headless=true to your JAVA_OPTS environment variable.

5. SiteStats configuration (offline)

Please refer to the Configuration Options page for more information.

6. modjk/mod_proxy_ajp configuration (offline)

If using Apache + mod_jk (or mod_proxy_ajp) in front of Tomcat, please make sure the url "/sakai-sitestats-tool" is also mapped to Tomcat.

7. Sakai setup (online)

7.1. Setup tool permissions

  1. Startup tomcat if not started yet
  2. Setup tool permissions for the maintain and Instructor role on the !site.template and !site.template.course templates:
    1. Click Realm
    2. Click !site.template
    3. Click Role Id - maintain
    4. Check:
      • sitestats.view box to grant an user permission to the SiteStats tool
      • sitestats.admin.view box to grant an user permission to the SiteStats Admin tool
    5. Click the Done Button
    6. Repeat for the Instructor role on the !site.template.course realm
    7. Repeat for the realms of existing sites or use a script for the effect
      Note: the SiteStats Admin tool allow to view statistics for any Sakai site

7.2. Add the SiteStats tool to a site

Use the 'Worksite setup' or the 'Site Info' tool to add SiteStats to a sakai site:

  1. click 'Add tools' link
  2. select SiteStats tool
  3. click 'Continue' to save changes

7.3. Add the SiteStats admin view (site list) to a site

Use the 'Sites' tool from the 'Administrator Workspace' to add SiteStats admin view to a sakai site:

  1. click the desired site id link
  2. click the 'Pages' button
  3. click 'New Page' link at the top
  4. give the page a name (eg, SiteStats Admin) and click 'Tools'
  5. click 'New Tool' link at the top
  6. check the sakai.sitestats.admin box
  7. click 'Save' to save changes
    Note: to use the tool, an user must have the sitestats.admin.view permission