Home>Article>Operation and Maintenance> How to install apache tomcat on linux

How to install apache tomcat on linux

藏色散人
藏色散人 Original
2019-08-09 11:16:50 3004browse

How to install apache tomcat on linux

Apache Tomcat, also known as Tomcat server, is an open source java servlet cotainer & provides a pure JAVA http webserver environmnet to run java code. It is very famous and widely used for running Java based websites all over the world. Apache Tomcat software powers a large number of mission-critical web applications across a wide range of industries and organizations.

Apache Tomcat can be used in various operating systems, such as Linux, Unix, Windows, etc. Apache Tomcat recently announced the end of life for the Tomcat 8.0.x version, although this will not affect the 8.5.x version.

How to install apache tomcat on linux?

In this tutorial, we will discuss the Apache Tomcat installation of v8.5, as it is the latest stable version (v9 is also available, which is still in BETA at the time of writing and does not currently have a stable version) .

Requirements

To install Tomcat 8.5, we will need JAVA 7 or higher. So first we need to install and setup JAVA on our system. You can install JAVA using the following command,

CentOS/RHEL $ sudo yum install java-1.8.0 Ubuntu/Debian $ sudo apt-get install openjdk-8*

Apache Tomcat Installation

For Apache Tomcat installation, we will use the following command to download the archived package from the official website,

$ wget http://redrockdigimark.com/apachemirror/tomcat/tomcat-8/v8.5.23/bin/apache-tomcat-8.5.23.tar.gz

Once the file has finished downloading, unzip the package in the /opt directory (we can also use some other directories/data etc.). Run the following command in the terminal to extract the files,

$ tar -xvzf pache-tomcat-8.5.23.tar.gz -C /opt $ mv /opt/apache-tomcat-8.5.23/ /opt/tomcat

Now Apache Tomcat is ready, but before we do that, we need to assign certificates to access tomcat's 'Manager' and 'GUI' pages, which are by default There is no username and password set. In order to verify the credentials we will use the '/opt/tomcat/conf/tomcat-users.xml' file,

$ vim /opt/tomcat/conf/tomcat-users.xml

and make the following entries to the file,

   

Make sure you are in the tag " Make these entries before tomcat-users" i.e. make the above entries before the lines mentioned below.

After completion, save the file and exit.

We need to make another change, although this is completely optional and completely depends on how you access the manager page. We can only access the management page from the browser on the local host, but we need to access it on other remote machines, we need to modify "context.html" for manager to comment out those lines that disable remote login,

$ vi /opt/tomcat/webapps/manager/META-INF/context.xml   –> 

The same applies to the host-manager context file,

$ vi /opt/tomcat/webapps/host-manager/META-INF/context.xml   –> 

We are now ready to start the tomcat server, go to the /opt/tomcat/bin folder and run the script named "startup.sh",

$ cd /opt/tomcat/bin $ sh startup.sh

How to install apache tomcat on linux

Apache Tomcat will start with the following output,

Now open a web browser of your choice and access the Apache Tomcat UI using the following URL,

http://192.168.1.100:8080

How to install apache tomcat on linux

Here, 192.168.1.100 is the IP address of the apache tomcat server. We will now be directed to the page below, where we can access the "Manager" and "Host Manager" pages by clicking on the corresponding tabs. After clicking on any tab we will be asked to authenticate in order to access the page. We need to enter the credentials we set up before to access the page.

How to install apache tomcat on linuxFor more Apache related knowledge, please visit the

Apache Usage Tutorial

column!

The above is the detailed content of How to install apache tomcat on linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn