Child pages
  • Install Tomcat 8

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen
  • Apache Tomcat - http://tomcat.apache.org/
  • Note: Always do a fresh install of Tomcat 8
  • Note: For now, please use Tomcat 8.0.32 . The community tested with 8.0.32 and later versions are currently experiencing . Later versions of Tomcat may cause problems. 
    JIRA
    serverSakai
    columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
    serverId66e9c5b5-d22c-30a2-a9d4-703f4354570c
    keySAK-31608
  • 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.31\
  1. 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

       

  2. 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)

      Code Block
      cd /opt
      tar xzvf apache-tomcat-8.0.x.tar.gz
      ln -nsf apache-tomcat-8.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.8)

    Tip
    titlePopulate 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.

     

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

      Code Block
      titleTomcat 8 Mac/Linux
      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:

      Code Block
      titleTomcat 8 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 
  7. [OPTIONAL] Delete the default webapps from the webapps dir

    No Format
    rm -rf webapps/*
    

Configure tomcat 8 to use the old tomcat 5.5 classloader dirs, this is not needed for the master branch of Sakai and Sakai 11. – I ASSUME THIS WHOLE SECTION SHOULD BE REMOVED! - neal

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

      • Tomcat 7

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

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

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

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

    No Format
    mkdir -p shared/classes shared/lib common/classes common/lib server/classes server/lib
    
Improve startup speed

You can improve startup speed under Tomcat 8 significantly.

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

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


 

...