I am in the process of moving my client’s app from Elastic Beanstalk to EC2.

In this post, I will outline the steps that I undertook to get Tomcat 8 runningwith Apache web server in front of it - all deployed in a Linux based EC2 in AWS.

Tomcat 8 supports Java WebSocket 1.0 In this tutorial, we'll learn how to install and configure latest release of Apache Tomcat 8 on CentOS 7 server. In this article, We are going to perform how to install Tomcat 8 on Ubuntu 18.04/16.04 LTS. Install Java, download tomcat 8. Configured environment variables. Apache Tomcat 8.0.53: Apache Tomcat is a web server that is an open source software implementation of the Java Servlet and JavaServer Pages technologies. 1,746,000 recognized programs - 5,228,000 known versions - Software News. 此时(20160509) Tomcat 8 最新版本为:apache-tomcat-8.0.32.tar.gz 我个人习惯 /opt 目录下创建一个目录 setups 用来存放各种软件安装包;在 /usr 目录下创建一个 program 用来存放各种解压后的软件包,下面的讲解也都是基于此习惯.

The assumption of this post is, you already have an AWS account and know your way around EC2.

First off, login to your AWS account and go to EC2.Launch an EC2 instance from the menu.

Pick a Linux based AMI here, my recommendation is Amazon Linux AMI. In the time of writing, Amazon Linux AMI 2018.03.0 (HVM),SSD Volume Type (ami-09b42976632b27e9b) is the latestAmazon Linux AMI and picked that up.

Remember to configure a security group, if you don’t already, that allows traffic on:

Tomcat8 Ssl

  • port 80 for the http
  • port 22 for ssh

Once your instance has launched, ssh into your instance.

Install Java 8

This step is optional as the AMI would have come with Java installed.

In my case, the pre-installed Java in the AMI is Java 7.However, I needed it to be Java 8 because Java version of the machine that produces the Grails WAR mustmatch the Java version where the WAR is deployed, I outlined whyin this post.

Install Tomcat 8

When you are inside your instance, run the following commands:

Install Apache httpd

Next we want to install Apache httpd to be a proxy in front of tomcat.

Install mod_jk

To get httpd and tomcat talk to each other we need a connector called mod_jk.

Tomcat 8

Build mod_jk

The steps below is a summary from Apache HTTP Server (mod_jk) HOWTO,which I encourage you to have a quick read before attempting the build below.


Configuration changes on httpd and tomcat8

mod_jk comes with a example, copy that to your tomcat8 directory:

Modify the

Add the following on

Tomcat 9 Download

Modify httpd.conf:

Add the following lines on the httpd.conf, you can place them anywhere in the file.However to be a little organised, I recommend putting these near the other LoadModule statements.

Now if all goes well, type in the URL of the EC2 to your browser and you should see the Tomcat welcome page.Worth noting, with this setup your site is served on port 80 as opposed to the usual port 8080 for tomcat.

Tomcat8 Free Download

Hope that helps :)