Installing and configuring the Tomcat server

  1. Install the Tomcat server using the following commands:

wget http://www-eu.apache.org/dist/tomcat/tomcat-8/v8.5.28/bin/apache-tomcat-8.5.28.tar.gz
tar - xvf apache-tomcat-8.5.28.tar.gz
mv apache-tomcat-8.5.28 tomcat8

2. Configure Java and Tomcat using the following steps:

a. Go to <tomcat home>/bin.

b. In the Catalina.sh file, enter the following commands:

export JAVA_HOME= <jdk home>/jdk1.8.x
CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=512m -Xms4096m -Xmx4096m"
CATALINA_PID= <tomcat home>/bin/catalina.pid

The values passed for "CATALINA_OPTS" will vary based on the memory allocation.

Under <$TOMCAT_HOME>/conf/, in the Server.xml file, do not change the default values for maxThreads and minSpareThreads (200 and 10 respectively).

3. Under the $TOMCAT_HOME/lib folder, create a file log4j.properties containing the following code:

# Global logging configuration
log4j.rootLogger=warning, R
log4j.logger.com.rapapp.platform.server=error
log4j.logger.com.rapapp.platform.server.script=error
log4j.logger.com.rapapp.platform.server.rest=error
log4j.logger.com.ibatis=error
log4j.logger.java.sql=error
log4j.logger.org.quartz=error
log4j.logger.org.apache=error
log4j.logger.org=error
log4j.logger.com.rapapp.platform.installer=error
log4j.logger.io.cloudio=error
# Console output
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{DATE} %5p %c{1}:%L - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=../logs/ra.log
log4j.appender.R.MaxFileSize=10240KB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{DATE} %5p %c{1}:%L - %m%n

4. Go to $TOMCAT_HOME/Conf/ and in the server.xml file, enable

compression using the following lines of code:

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
compression="on" compressionMinSize="8192" useSendfile="false" compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript"
redirectPort="8443" />

If useSendfile is set to ‘false’, then any compression that Tomcat may have otherwise performed on the response will be disabled.

5. Deploy the WAR file using the following steps:

  • Run the following command: cd tomcat8/webapps/

  • Backup the existing WAR file, if any, and delete it.

  • Move the CloudIO WAR file into the webapps folder and rename it as ROOT.war.

  • Run the following command: cd $TOMCAT_HOME/bin/

  • Start the Tomcat server using the following command: ./startup.sh

Last updated