• Apache Tomcat - http://tomcat.apache.org/
  • Note: Always do a fresh install of Tomcat (please note that Tomcat has a bug. Please use Tomcat 7.0.65 or Tomcat 7.0.68, when released. Addendum 30January2017 - appears to work with 7.0.75 as of this writing. Is known not to work with 7.0.72 through 7.0.74 )
  • 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 7.0.1\
  1. Download Tomcat 7 if you're using Sakai 10- http://tomcat.apache.org/download-70.cgi
    Download Tomcat 8 if you're using Sakai 11 - https://tomcat.apache.org/download-80.cgi
    (The directions below are mostly the same for 7 or 8, but the setenv.sh is a little different)

    • 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

      If you're running the tag of Sakai 2.9.1 or earlier you need to be running Tomcat 7.0.21 or earlier. If you go any higher Webdav and Sitestats will have errors and not work. A better solution is to upgrade to the latest version of Sakai and Tomcat.
  2. Extract to /opt (symlink the apache-tomcat-7.0.x directory to tomcat after extracting)
    • Example (assuming you have saved the file as /opt/apache-tomcat-7.0.x.tar.gz)

      cd /opt
      tar xzvf apache-tomcat-7.0.x.tar.gz
      ln -nsf apache-tomcat-7.0.x tomcat
    • Windows users should just rename the directory since they cannot symlink
  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 (from Install Java 1.7+)

    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.

     

    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):

      export JAVA_OPTS="-server -Xmx1028m -XX:MaxPermSize=320m -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Djava.awt.headless=true -Dcom.sun.management.jmxremote"
      
      export JAVA_OPTS="-server -Xmx1028m -XX:MaxMetaspaceSize=512m -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Djava.awt.headless=true -Dcom.sun.management.jmxremote"
      
    2. Windows(PC): Create a file called setenv.bat with the following:

      set JAVA_OPTS=-server -Xmx1028m -XX:MaxPermSize=320m  -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Djava.awt.headless=true -Dcom.sun.management.jmxremote
      
      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 
  7. [OPTIONAL] Delete the default webapps from the webapps dir

    rm -rf webapps/*
    

Configure tomcat 7/8 to use the old tomcat 5.5 classloader dirs, this is not needed for the master branch of Sakai and Sakai 11.

  1. Edit conf/catalina.properties
    1. Add the following to the line that begins with "common.loader=..."

      • Tomcat 7

        ,${catalina.base}/common/classes/,${catalina.base}/common/lib/*.jar
        
      • Tomcat 8

        ,"${catalina.base}/common/classes/","${catalina.base}/common/lib/*.jar"
        
    2. Add the following to the line that begins with "server.loader=..."

      ${catalina.base}/server/classes/,${catalina.base}/server/lib/*.jar
      
    3. Add the following to the line that begins with "shared.loader=..."

      ${catalina.base}/shared/classes/,${catalina.base}/shared/lib/*.jar
      
  2. Create the directories

    mkdir -p shared/classes shared/lib common/classes common/lib server/classes server/lib
    

Improve startup speed

You can improve startup speed under both Tomcat 7 and Tomcat 8 significantly.

Tomcat 7

Edit the file conf/catalina.properties and add the property to the bottom

org.apache.catalina.startup.ContextConfig.jarsToSkip=*.jar

Tomcat 8

Edit the file conf/context.xml and add this JarScanFilter block to the context

<Context>
    <JarScanner>
        <JarScanFilter defaultPluggabilityScan="false" />
    </JarScanner>
</Context>


 

  • Apache Tomcat - http://tomcat.apache.org/
  • Note : Toujours faire une nouvelle installation de Tomcat
  • Note : Les utilisateurs de MS Windows doivent s'assurer qu'il n'y a pas d'espaces dans le nom du chemin complet de l'installation de Tomcat, ceux-ci provoquent des erreurs avec les outils développé en JSF dans Sakai
    BON : C:\opt\tomcat\, C:\sakaistuff\installs\tomcat\
    MAUVAIS : C:\program files\tomcat\, C:\opt\apache tomcat 7.0.1\
  1. Télécharger tomcat 7 à  http://tomcat.apache.org/download-70.cgi
    • Les utilisateurs de MS Windows doivent récupérer le fichier zip et utiliser les fichiers .bat fournis pour l'arret/relance au lieu de l'installer en tant que service de MS Windows
      Il permet d'afficher et de lire plus facilement les journaux de Tomcat, et il est plus facile à configurer

      Si vous utilisez Sakai 2.9.1 ou une version antérieure, vous devez utiliser Tomcat 7.0.21 ou une version antérieure. Si vous utilisez une version supérieure à la 7.0.21, Webdav et Sitestats auront des erreurs et ne fonctionneront pas. La meilleure solution est de passer à la dernière version de Sakai et de Tomcat.
  2. Décompresser l'archive de Tomcat (tar.gz ou tar.bz2) dans le répertoire /opt (créer un lien symbolique entre le nouveau répertoire apache-tomcat-7.0.x qui vient d'être créé et le répertoire tomcat après la décompression)
    • Les utilisateurs de MS Windows doivent juste renommer le répertoire apache-tomcat-7.0.x en tomcat, après décompression de l'archive zip de Tomcat, puisque la possibilité de faire des liens symboliques n'existent pas sur MS Windows
  3. Extraire les fichiers vers le même endroit que que tomcat lui-même (Ndt : phrase pas claire, fichiers de Tomcat ou de Sakai ?, phrase inutile désormais ?)
  4. Modifier le fichier conf/server.xml pour ajouter le support des caractères internationaux, c'est à dire non anglo-saxon, par exemple avec des caractères accentués pour le français.
    1. Ajouter le paramètre URIEncoding="UTF-8" dans la section de l'élément Connector
      • <Connector port="8080" URIEncoding="UTF-8" ...
  5. Paramétrer la variable d'environnement suivante : CATALINA_HOME=/opt/tomcat via la commande système suivante : export CATALINA_HOME=/opt/tomcat
  6. Ajouter le chemin du répertoire $CATALINA_HOME/bin à la variable du système PATH via la commande système suivante : export PATH=$PATH:$CATALINA_HOME/bin
  7. Créer le fichier SETENV dans le répertoire tomcat/bin avec la variable d'environnement JAVA_OPTS (depuis Install Java 1.7+)
    1. Pour Mac/Linux: Créer un fichier appelé setenv.sh avec le code suivant  (d'une autre façon, vous pouvez mettre celui-ci dans votre fichier .bashrc ainsi il sera exécuté automatiquement):

      export JAVA_OPTS="-server -Xmx1028m -XX:MaxPermSize=320m -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Djava.awt.headless=true -Dcom.sun.management.jmxremote -Dsun.lang.ClassLoader.allowArraySyntax=true"
      
    2. Pour MS Windows(PC): Créer un fichier appelé setenv.bat avec le code suivant:

      set JAVA_OPTS=-server -Xmx1028m -XX:MaxPermSize=320m  -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Djava.awt.headless=true -Dcom.sun.management.jmxremote -Dsun.lang.ClassLoader.allowArraySyntax=true
      
  8. [FACULTATIF] Supprimer l'application web par défaut dans le répertoire webapps

    rm -rf webapps/*
    
  9. Configurer Tomcat 7 pour utiliser les vieux répertoires du chargeur de classes (classloader) de Tomact 5.5
    1. Editer le fichier conf/catalina.properties
      1. Ajouter le texte (paramètres) ci-dessous à la ligne qui commence par le texte "common.loader=..."

        ,${catalina.base}/common/classes/,${catalina.base}/common/lib/*.jar
        
      2. Ajouter le texte (paramètres) ci-dessous à la ligne qui commence par le texte "shared.loader=..."

        ${catalina.base}/shared/classes/,${catalina.base}/shared/lib/*.jar
        
      3. Ajouter le texte (paramètres) ci-dessous à la ligne qui commence par le texte "server.loader=..."

        ${catalina.base}/server/classes/,${catalina.base}/server/lib/*.jar
        
    2. [FACULTATIF] Créer les répertoires

      mkdir -p shared/classes shared/lib common/classes common/lib server/classes server/lib