Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Documents downloading, installing, and configuring tomcat.

Details

Download and install tomcat and the tomcat apps as Linux packages.

...

  1. Change where CATALINA_PID goes so that it is writeable by this user (applies to /etc/init.d/tomcat7 as well as /etc/tomcat7.conf, depending on your environment).

     

    Code Block
    CATALINA_PID="/var/lib/tomcat7/$NAME.pid"
    # also change all instances of /var/run to /var/lib/tomcat7
  2. Set permissions of the tomcat installation to the new user

     

    Code Block
    # foreach linked directory in /usr/share/tomcat7 (on Amazon AMI)
    chown -R ec2-tomcat:ec2-tomcat $dir
    
    Edit /etc/init.d/tomcat7 to use the following
    * TOMCAT_USER=ec2-tomcat
    * TOMCAT_GROUP=ec2-tomcat
    
    
    Also edit /etc/tomcat7.conf
    * CATALINA_PID=/var/lib/tomcat7/tomcat7.pid
    * TOMCAT_USER=ec2-tomcat
    * TOMCAT_GROUP=ec2-tomcat
    
    
    Make sure all the "chown"commands in the script change to group to $TOMCAT_USER

     

  3. NOTE: the tomcat user should be able to start/stop the server with "/usr/sbin/tomcat7 start/stop".  If not, you  may need to edit /etc/init.d/tomcat7 a little in a custom way for your system.  If the process was started by root, it will likely have to be killed by root first. 

  4. Tomcat must be configured to pass "run.config.umls" environment variable to the application:
    1. One way to do this is to invoke the java command with -Drun.config.ts=/home/ihtsdo/data/config.properties
      (e.g. edit this in /usr/share/tomcat7/conf/tomcat7.conf and add to JAVA_OPTS)
    2. Also add -Xmx2500M to JAVA_OPTS in the tomcat startup script.
    3. NOTE: development environments must also be configured as such
  5. Tomcat may be configured to support POST requests of size > 2MB
    1. Edit server.xml and add  maxPostSize="50000000" to each <Connector> element.
  6. Tomcat must be configured to support following of links.  Make sure any Context tags in the configuration contain  allowLinking="true".
    1. Edit context.xml to add this parameter to the Context tag
  7. To enable tomcat manager, add this to tomcat-users.xml file.

     

    Code Block
    <role rolename="manager-gui"/>
    <user name="tomcat" password="********" roles="manager-gui"/>
    <role rolename="protected"/>

References