Tomcat: Difference between revisions

From Alpine Linux
Line 21: Line 21:
{{Cmd|sh catalina.sh version}}
{{Cmd|sh catalina.sh version}}


You should see a list of folders, the installed tomcat version, OS name, processor architecture and so on.
You should see a list of folders, the installed tomcat version, OS name, processor architecture and so on. If this fails, either the installed version of tomcat is somehow incompatible with the installed version of Java or one of the two programs was not properly installed.


Tomcat consists of several components, Catalina is the part responsible for running the server.
Tomcat consists of several components, Catalina is the part responsible for running the server.


== Running Tomcat ==
== Running Tomcat ==

Revision as of 17:20, 16 September 2017

Tomcat is a web server with a built-in Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket interpreter that can also serve static HTML pages.

This How-To describes how to set-up Tomcat to deliver static HTML pages as well as prepared WAR packages.

Installation

Java

Tomcat requires the Java Runtime Environment, which is available from the Alpine repository as openjdkN (where N stands for the version). Install the most up to date version of Java, 8 at the time of writing (September 2017).

apk add openjdk8

Tomcat

Tomcat has to be downloaded from the Apache Tomcat homepage. You need the Binary Distribution Core, download it, save it in a place where you can easily find it and extract it into a folder of your choice. As most other manuals for Tomcat use /usr/local/tomcat, this manual will assume that Tomcat is extracted there as well and call it $TOMCAT$ from now on.

cd /usr/local/tomcat

tar xvzf apache-tomcat-9.0.0.M26.tar.gz

Testing

Tomcat should run without any further configuration. Switch to $TOMCAT$/bin and execute the following command:

cd /usr/local/tomcat/bin

sh catalina.sh version

You should see a list of folders, the installed tomcat version, OS name, processor architecture and so on. If this fails, either the installed version of tomcat is somehow incompatible with the installed version of Java or one of the two programs was not properly installed.

Tomcat consists of several components, Catalina is the part responsible for running the server.

Running Tomcat