Installing Java 7 and Tomcat 7
I often post about Java and Tomcat on Twitter. Follow me here Follow @alextheedom
Install Java 7
We need to download and install Java 7 ARM v6/7 Linux headless edition and tomcat 7.
- go to the usr directory and create a new directory and name it java
- from within this directory download and install java
- wget http://download.oracle.com/otn-pub/java/ejre/7u10-b18/ejre-7u10-fcs-b18-linux-arm-vfp-client_headless-28_nov_2012.tar.gz > java7.tar.gz
- apt-get install openjdk-7-jdk
- clean up the install: apt-get clean
Install Tomcat 7
- now download and decompress Tomcat:
- wget http://mirrors.axint.net/apache/tomcat/tomcat-7/v7.0.34/bin/apache-tomcat-7.0.34.tar.gz
- tar xzf apache-tomcat-7.0.34.tar.gz
- Now all is installed you can verify the version of java installed by typing: java -version
- start tomcat
- from the directory where you installed tomcat type: bin/startup.sh
- to start tomcat type: bin/shutdown.sh
- Now go to your PC and open a browser and type the IP address of the Pi and the console of tomcat will appear: http://192.168.1.200:8080/
One of the most important developments in JavaEE 8 and Java 9 will be support for HTTP/2. Tomcat 9 supports HTTP/2 but it must be configured to use TLS. Head on over to Configure Tomcat 9 for HTTP/2 to find out how to add the appropriate configurations.
Apache ant can be used to automate the compilation, deployment and launch of Tomcat all with a simple Ant script. Find out how to automate these task in my article: Compile, deploy and start Tomcat with Ant script.
Amazon Web Services offers free usage for 12 months that allows you to install Tomcat. The free tier consists of 14 services, the EC2 service is of most interest to developers. I show you how to install and configure Tomcat on an EC2 instance: Amazon Free Usage Tier: Installing Tomcat 7 on an EC2 Linux instance.
One of the most important configuration files in Tomcat is server.xml.I have posted an example of this file in my blog post: Tomcat server.xml example.
Tomcat is often set up with Apache and mod_jk cluster. In this article I will go through a common set-up for a small production environment: a single tier, load balanced application server cluster.