How to Install Tomcat and Java on CentOS 6.7

Illustration by Walker Cahall
Verified and Tested 1/21/15
Introduction
This tutorial will take you through installing Tomcat 8 on CentOS 6.7 x86_64. Tomcat is an application server that is used to execute Java servlets and publish web pages that include Java coding. Tomcat requires Java to be installed which will be covered in this tutorial.
Prerequisites
An Atlantic.Net Cloud Server with the CentOS 6.7 x86_64 operating system. If you do not have one, consider one of our many affordable cloud server hosting solutions.
Installing Java and Tomcat on CentOS 6.7
The first step to installing Tomcat is to first install the Java JDK. At the time of this article, the most up-to-date version of Java is Java SE 8u25. It is very likely that Java will have updated from this point, but the process is the same. You can find the available JDKs from the Java website.
Once on the website, click the Download button under JDK to go to the JDK’s download page. Once there, choose and copy the link location for the OS that you need (in our case the Linux x64 version) and on your server type:
wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense= accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u25-b1 7/jdk-8u25-linux-x64.rpm" -O jdk-8-linux-x64.rpm
This will download the JDK to your server where you can then install it by running:
rpm -Uvh jdk-8-linux-x64.rpm
Once that is installed, you only need to install Tomcat now. You can find the latest version of Tomcat on the Tomcat website. At the time of this article, the latest version of Tomcat 8 is Tomcat 8.0.15. You can install it by running:
wget http://psg.mtu.edu/pub/apache/tomcat/tomcat-8/v8.0.15/bin/apache-tomcat-8.0.15.tar.gz
Once downloaded, run the below to extract and essentially install it.
tar -xzf apache-tomcat-8.0.15.tar.gz
After extracting Tomcat from the download file, you have essentially installed it and it is ready for any configuration you’d like to do. Once the extraction is done, you can rename or move the freshly extracted folder “apache-tomcat-8.0.15” to anything/where you’d like. Be sure to keep track of it’s location, as to start/stop the service, you will need to use the startup.sh and shutdown.sh scripts that are contained in the /bin directory within the folder. Finally, to perform any configuration, you will need to edit the server.xml which is contained in the extracted folder’s /conf directory. You do not need to edit this to see if Tomcat is working. All you would need to do is run the startup.sh and the server will start Tomcat without any configuration changes being made. (Make sure you have the port open in your firewall!)
Congratulations! You have just installed Tomcat and Java on your CentOS 6.7 Cloud Server. Thank you for following along in this How-To, and check back with us for any new updates. You may want to follow the guides on changing the CentOS 6.7 hostname or spend some time learning the initial Centos 6 setup. For more information on our reliable cloud hosting solutions, contact us today for a consultation.
Free Tier Includes:
G2.1GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
Looking for a Hosting Solution?
We Provide Cloud, Dedicated, & Colocation.
- Seven Global Data Center Locations.
- Flexible Private, Public, & Hybrid Hosting.
- 24x7x365 Security, Support, & Monitoring.





Case Studies
White Papers
Resources
Recent Posts
- How to Set Up a Full-Featured Mail Server with iRedMail on Ubuntu 18.04 VPS
- How to Add PHP-FPM Support on Apache and Nginx Web Server on Ubuntu 18.04
- How to Configure UFW Firewall on Ubuntu 18.04
- Install LAMP Server with Let's Encrypt Free SSL on Ubuntu 18.04
- HIPAA Security Rule Checklist: What is the HIPAA Security Rule?