Apache Tomcat 9 Installation on Linux (RHEL and clones)
Apache Tomcat 9 is not available from the standard RHEL distributions, so this article provides information about the manual installation and basic configuration of Apache Tomcat 9 on RHEL and its clones from tarballs. The tarball approach to installation is largely unchanged compared to previous tomcat versions.

- Downloads
- Installation
- Checking the Status of Tomcat
- Configuration Files
- Enabling HTML Management Access
- Deploying Applications
Related articles.
- Apache Tomcat 7 Installation on Linux (RHEL and clones)
- Apache Tomcat 8 Installation on Linux (RHEL and clones)
Downloads
Download the following software. This article assumes these downloads are present in the "/tmp" directory on the server.
- Java SE Development Kit 8 Downloads (I used jdk-8u131-linux-x64.tar.gz)
- Apache Tomcat (I used apache-tomcat-9.0.0.M22.tar.gz)
Installation
Create a user called "tomcat" to own the Tomcat installation.
# useradd tomcat
Install the JDK from the tarball under the tomcat user.
# su - tomcat
$ tar xzf /tmp/jdk-8uu131-linux-x64.gz
Install Tomcat from the tarball under the home directory of the "tomcat" user.
$ tar xzf /tmp/apache-tomcat-9.0.0.M22.tar.gz
Set the following environment variables and append them to the "/home/tomcat/.bash_profile" so they are set for subsequent logins.
export JAVA_HOME=/home/tomcat/jdk1.8.0_131
export CATALINA_HOME=/home/tomcat/apache-tomcat-9.0.0.M22
export CATALINA_BASE=$CATALINA_HOME
Start and stop Tomcat using the following scripts.
$ $CATALINA_HOME/bin/startup.sh
$ $CATALINA_HOME/bin/shutdown.sh
The Tomcat logs are written to the "$CATALINA_HOME/logs/" directory by default.
Once Tomcat is started, the following URL should be available. Configuration for the management URLs is discussed below.
http://localhost:8080/
http://localhost:8080/manager/html
http://localhost:8080/manager/status
Remember to open up the port on the firewall if you want to access the site from other servers on the network. Information about the Linux firewall is available here.
Checking the Status of Tomcat
There are several ways to check the status of the service.
$ netstat -nlp | grep 8080
tcp 0 0 :::8080 :::* LISTEN 4470/java
$
$ ps -ef | grep tomcat
tomcat 17848 1 7 10:43 pts/0 00:00:14 /u01/java/jdk1.8.0_131/bin/java -Djava.util.logging.config.file=/home/tomcat/apache-tomcat-9.0.0.M22/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -classpath /home/tomcat/apache-tomcat-9.0.0.M22/bin/bootstrap.jar:/home/tomcat/apache-tomcat-9.0.0.M22/bin/tomcat-juli.jar -Dcatalina.base=/home/tomcat/apache-tomca -9.0.0.M22 -Dcatalina.home=/home/tomcat/apache-tomcat-9.0.0.M22 -Djava.io.tmpdir=/home/tomcat/apache-tomcat-9.0.0.M22/temp org.apache.catalina.startup.Bootstrap start
tomcat 18055 17257 0 10:43 pts/0 00:00:00 ps -ef
tomcat 18056 17257 0 10:43 pts/0 00:00:00 grep tomcat
$
$ curl -I http://localhost:8080
HTTP/1.1 200
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 13 Jul 2017 09:49:56 GMT
$
The status is also available from the HTML management page.
Configuration Files
The main locations of configuration and log information are shown below.
Release Notes : $CATALINA_HOME
Config : $CATALINA_HOME/conf
Bin Directory : $CATALINA_HOME/bin
Webapps : $CATALINA_HOME/webapps
Logs : $CATALINA_HOME/logs
Enabling HTML Management Access
Edit the "$CATALINA_HOME/conf/tomcat-users.xml" file, adding the following entries inside "tomcat-users" tag. Adjust the password as required.
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="MyPassw0rd!" roles="manager-gui,admin-gui"/>
Edit the "$CATALINA_HOME/webapps/manager/META-INF/context.xml" and "$CATALINA_HOME/webapps/host-manager/META-INF/context.xml" file, disable the "Value" tag.
<!--
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
-->
Restart Tomcat for the configuration to take effect.
$ $CATALINA_HOME/bin/shutdown.sh
$ $CATALINA_HOME/bin/startup.sh
The management application is now available from the "http://localhost:8080/manager/html" URL.
Deploying Applications
You can get a sample application WAR file to test with from "http://tomcat.apache.org/tomcat-9.0-doc/appdev/sample/".
If this is a redeployment, delete the existing deployment from the "$CATALINA_HOME/webapps" directory.
# rm -Rf $CATALINA_HOME/webapps/sample
Place the "sample.war" file in the "$CATALINA_HOME/webapps" directory and Tomcat with automatically deploy it. You will see a "sample" directory appear.
You don't need to stop and start Tomcat for this to work, but you can if you want.
$ $CATALINA_HOME/bin/shutdown.sh
$ $CATALINA_HOME/bin/startup.sh
For more information see:
- Apache Tomcat
- Apache Tomcat 7 Installation on Linux (RHEL and clones)
- Apache Tomcat 8 Installation on Linux (RHEL and clones)
Hope this helps. Regards Tim...
来自 <https://oracle-base.com/articles/linux/apache-tomcat-9-installation-on-linux>
Apache Tomcat 9 Installation on Linux (RHEL and clones)的更多相关文章
- 一步一步教你如何在linux下配置apache+tomcat(转)
一步一步教你如何在linux下配置apache+tomcat 一.安装前准备. 1. 所有组件都安装到/usr/local/e789目录下 2. 解压缩命令:tar —vxzf 文件名(. ...
- Linux平台上搭建apache+tomcat负载均衡集群
传统的Java Web项目是通过tomcat来运行和发布的.但在实际的企业应用环境中,采用单一的tomcat来维持项目的运行是不现实的.tomcat 处理能力低,效率低,承受并发小(1000左右).当 ...
- linux下一个apache+tomcat负载均衡和集群
先说一下我的环境 一个ubuntu虚拟机, 一个apache2.2示例 两tomcat1.7示例 1.安装apacheserver sudo apt-get install apache2 假设要重新 ...
- Linux CentOS 7 下 Apache Tomcat 7 安装与配置
前言 记录一下Linux CentOS 7安装Tomcat7的完整步骤. 下载 首先需要下载tomcat7的安装文件,地址如下: http://mirror.bit.edu.cn/apache/tom ...
- Linux中Apache+Tomcat+JK实现负载均衡和群集的完整过程
人原创,一个字一个字地码的,尊重版权,转载请注明出处! http://blog.csdn.net/chaijunkun/article/details/6987443 最近在开发的项目需要承受很高的并 ...
- Eclipse配置tomcat8.5.7报错:The Apache Tomcat installation at this directory is version 8.5.27. A Tomcat 8.0 installation is...
Eclipse配置tomcat8.5.7报错:The Apache Tomcat installation at this directory is version 8.5.27. A Tomcat ...
- 朝圣Java(问题集锦)之:The Apache Tomcat installation at this directory is version 8.5.32. A Tomcat 8.0 inst
最近开始学Java了.有C#底子,但是学起来Java还是很吃力,感觉别人架好了各种包,自己只要调用就行了,结果还有各种bug出现.掩面中. 启动Tomcat的时候,报错The Apache Tomca ...
- linux环境下Apache+Tomcat集群配置
写在前面 apache配置多个tomcat,实现请求分流,多个tomcat服务均衡负载,增加服务的可靠性.最近研究了一下,遇到许多问题,记录一下,方便以后查阅,不喜欢apache,nginx也是可以做 ...
- The Apache Tomcat installation at this directory is version 8.5.24 Tomcat 8.0 installation is expect
在一台新电脑上搭建Java开发环境,JDK 是1.8,Tomcat下载了Tomcat 8.5.24,已经配置好了Java和Tomcat的环境变量,开发工具是Eclipse MARS,准备在Eclips ...
随机推荐
- File /data/binlog/mysql-bin.index' not found (Errcode: 13)
[问题] 需要开启bin-log备份/恢复数据库,但是因为本身bin-log保存的位置存储太小,并且归类性也不好,所以自己新创建了/data/binlog来保存二进制日志 在/etc/my.cnf增加 ...
- js和css实现内容超过边框,就自动省略,自动添加title
在项目汇总,我们有这样的需求,如果内容多了,就自动省略,自动添加title 这个需要判断判断俩个值,一个是width(),一个是scrollWidth, 在div中,如果内容没有超过边框,这俩个值是一 ...
- K-means聚类算法的三种改进(K-means++,ISODATA,Kernel K-means)介绍与对比
一.概述 在本篇文章中将对四种聚类算法(K-means,K-means++,ISODATA和Kernel K-means)进行详细介绍,并利用数据集来真实地反映这四种算法之间的区别. 首先需要明确 ...
- 掩膜 rcnn
更多讨论,参考知乎:https://www.zhihu.com/question/57403701
- .NetCore下使用Prometheus实现系统监控和警报 (三)集成Grafana
有了前面InfluxDB的经验,这里就很好处理了,数据类型选择Prometheus选地址等,填好保存 同样通过导入数据处理,我们在https://grafana.com/dashboards上选择Da ...
- 【LOJ】#2494. 「AHOI / HNOI2018」寻宝游戏
题面 题解 第\(i\)个数之前的符号是或那么记为0,是与就记为1,得到一个二进数x 然后按位分开考虑,如果这一行是1那么记为1,如果这一位数位0记为0,得到一个二进制数\(b_i\) 第\(N\)行 ...
- ModelDriven 和 Preparable 拦截器
Params 拦截器 Parameters 拦截器将把表单字段映射到 ValueStack 栈的栈顶对象的各个属性中. 如果某个字段在模型里没有匹配的属性, Param 拦截器将尝试 ValueSta ...
- Codeforces 311B Cats Transport 斜率优化dp
Cats Transport 出发时间居然能是负的,我服了... 卡了我十几次, 我一直以为斜率优化写搓了. 我们能得出dp方程式 dp[ i ][ j ] = min(dp[ k ][ j - 1 ...
- Java 发送http post 请求
package com.sm.utils; import java.io.BufferedReader; import java.io.InputStreamReader; import java.i ...
- 命令:mktemp
简介 mktemp命令用于创建一个临时的文件或者目录. 语法格式 mktemp [OPTION]... [TEMPLATE] 示例 不带选项和参数的mktemp用于创建临时文件,带-d选项用于创建临时 ...