📙 You will learn
How to install and configure ThreadFix on Ubuntu. While currently ThreadFix supports Ubuntu 12.04 and newer, these instructions were developed and tested against Ubuntu 16.04.
Prerequisites
Audience: IT Professional and/or End User
Difficulty: Intermediate
Time needed: Approximately 60 minutes
Tools required: OpenJDK 11 or OpenJDK 8 or Oracle Java 8, at least Tomcat 7.0.59, MySQL or Microsoft SQL Server
Install Java
ThreadFix 2.7.9 and newer can run on OpenJDK 11 (or Oracle Java 8 / OpenJDK 8, shown in the sections below).
OpenJDK 11
To install, open a Terminal and run the following commands:
sudo apt-get update
sudo apt-get install openjdk-11-jre
If you have multiple JREs installed, run the sudo update-alternatives --config java
command and select the version installed above.
OpenJDK 8
To install, open a Terminal and run the following commands:
sudo apt-get update
sudo apt-get install openjdk-8-jre
If you have multiple JREs installed, run the sudo update-alternatives --config java
command and select the version installed above.
Oracle Java 8
To deploy versions of ThreadFix 2.6.2.6 and older, you'll need to use Oracle Java 8. To pull the Oracle version, you'll need to add a repository by opening Terminal and running the following commands:
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
Select "OK" to proceed through the install, and accept the license terms.
ThreadFix requires at least Tomcat 7.0.59, but we recommend the latest version of Tomcat 8.5.
1. Download the latest version of Tomcat 8.5
wget https://mirrors.gigenet.com/apache/tomcat/tomcat-8/v8.5.59/bin/apache-tomcat-8.5.59.tar.gz
2. Create a directory to install Tomcat 8, then extract the tar ball there
sudo mkdir /opt/tomcat
sudo tar xvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1
3. Create a group and user to manage the Tomcat execution.
sudo groupadd tomcat
sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
Web.xml Update
For compatibility with Tomcat 8.5.43 and newer, make the following update:
Open the <tomcat-deploy>/conf/web.xml file in a text editor with elevated privilege and edit the default servlet as follows:
OLD
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Enable Tomcat Service
If you want tomcat to run as a service that you can have start automatically at boot, the preferred method in Ubuntu 16.04 is using systemd. Create a file at /etc/systemd/system/tomcat.service
with the following content.
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=mysql.service network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms2G -Xmx8G -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
Reload Systemd to load the Tomcat unit file and enable the tomcat.service.
sudo systemctl daemon-reload
sudo systemctl enable tomcat.service
SSL/TLS Implementation
For information on configuring Tomcat to run over SSL/TLS, refer to the following article.
Once you've followed the steps above, you're ready to install ThreadFix. Please see the ThreadFix Installation guide to complete your deployment.
Related articles
📄 CentOS Enterprise Setup
📄 Mac OS Enterprise Setup
📄 ThreadFix Installation
📄 Windows Enterprise Setup