/
Installing and Configuring Tomcat 7
Installing and Configuring Tomcat 7
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.
- 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
Set permissions of the tomcat installation to the new user
#
for
each 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
- 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.
- Tomcat must be configured to pass "run.config.ts" environment variable to the application:
- 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) - Also add -Xmx2500M to JAVA_OPTS in the tomcat startup script.
- NOTE: development environments must also be configured as such
- One way to do this is to invoke the java command with -Drun.config.ts=/home/ihtsdo/data/config.properties
- Tomcat may be configured to support POST requests of size > 2MB
- Edit server.xml and add maxPostSize="50000000" to each <Connector> element.
- Tomcat must be configured to support following of links. Make sure any Context tags in the configuration contain allowLinking="true".
- Edit context.xml to add this parameter to the Context tag\
To enable tomcat manager, add this to tomcat-users.xml file.
<role rolename="manager-gui"/> <user name="tomcat"password="********"roles="manager-gui"/> <role rolename="protected"/>
References
, multiple selections available,
Related content
Deploy Instructions
Deploy Instructions
More like this
Admin Tools
Admin Tools
More like this
Admin Tools
Admin Tools
More like this
Building and Deploying in Eclipse
Building and Deploying in Eclipse
More like this