It also enables Tomcat to run when the server is started. This script tells the server to run the Tomcat service as the tomcat user, with the settings specified. etc/init/nf description "Tomcat Server"Įnv JAVA_HOME= /usr/lib/jvm/java-7-openjdk-amd64/jreĮnv JAVA_OPTS="=true =file:/dev/./urandom"Įnv CATALINA_OPTS="-Xms 512M -Xmx 1024M -server -XX:+UseParallelGC" The easiest way to look up that location is by running this command: This path is commonly referred to as “JAVA_HOME”. Tomcat needs to know where Java was installed. Install Upstart Scriptīecause we want to be able to run Tomcat as a service, we will set up an Upstart script. Now that the proper permissions are set up, let’s set up an Upstart init script. Then make the tomcat user the owner of the work, temp, and logs directories: Then give the tomcat user write access to the conf directory, and read access to the files in that directory: The tomcat user that we set up needs to have the proper access to the Tomcat installation. Now we’re ready to set up the proper user permissions. sudo tar xvf apache-tomcat-8*tar.gz -C /opt/tomcat –strip-components=1.Create the directory, then extract the the archive to it with these commands: We’re going to install Tomcat to the /opt/tomcat directory. Then use wget and paste in the link to download the Tomcat 8 archive, like this (your mirror link will probably differ from the example): Let’s download the latest binary distribution to our home directory. Under the Binary Distributions section, then under the Core list, copy the link to the “tar.gz”. At the time of writing, the latest version is 8.0.23. Download Tomcat Binaryįind the latest version of Tomcat 8 at the Tomcat 8 Downloads page. The easiest way to install Tomcat 8 at this time is to download the latest binary release then configure it manually.