Overview

Documents downloading, installing, and configuring tomcat.

 

Details

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

 

It is recommended that you run tomcat as a user other than the default tomcat7 user so that admin tasks which change the indexes.  To enact this, consider the following configuration changes.

 

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

     

    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 (assumes "ihtsdo" user)

     

    foreach linked directory in /usr/share/tomcat7 (on Amazon AMI)
    chown -R ihtsdo $dir

    Edit /etc/init.d/tomcat7 to use the following
    * TOMCAT_USER=ihtsdo
    * TOMCAT_GROUP=ihtsdo

    Also edit /etc/tomcat7.conf - if this applies to your environment
    * CATALINA_PID=/var/lib/tomcat7/tomcat7.pid
    * TOMCAT_USER=ihtsdo
    * TOMCAT_GROUP=ihtsdo

    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" environment variable to the application:
    1. One way to do this is to invoke the java command with -Drun.config=/home/ihtsdo/data/config.properties
      (e.g. edit this in /usr/share/tomcat7/conf/tomcat7.conf and add to JAVA_OPTS or in /etc/init.d/tomcat7 - this may vary depending on your system)
    2. Also add -Xmx2500M to JAVA_OPTS as well.
    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.

     

References

 

 

  • No labels