Tomcat 多实例应用

一、Tomcat应用场景:

 

    单实例单应用:比较常用的一种方式,只需要把你打好的 war 包丢在 webapps目录下,执行启动 Tomcat 的脚本就行了。

    单实例多应用:有两个不同的 Web 项目 war 包,还是只需要丢在webapps目录下,执行启动 Tomcat 的脚本,访问不同项目加上不同的虚拟目录。(切勿在生产环境使用,因为重启或挂掉 Tomcat 后会影响另外一个应用的访问)

    多实例单应用:多个 Tomcat 部署同一个项目,端口号不同,可以利用 Nginx 这么做负载均衡,当然意义不大。

    多实例多应用:多个 Tomcat 部署多个不同的项目。这种模式在服务器资源有限,或者对服务器要求并不是很高的情况下,可以实现多个不同项目部署在同一台服务器上的需求,来实现资源使用的最大化。-

 

 

二、部署Tomcat(以多实例多应用为例):

 

CATALINA HOME  bin  Tomca&kffßf4  Tomca  CATALINA BASE  conf  webapps  temp  logs  work

 

注意:官方文档建议将tomcat目录下的confwebappstemplogswork这五个目录剪切至对应的实例文件存放目录里面去

 

1、安装jdk,并配置java环境

 

1.1、访问http://www.oracle.com/technetwork/java/javase/downloads/index.html,下载对应的jdk

 

ORACLE  Menu  Sign In v  Training  Country/Region v  Call  Oracle Technology Network / Java / Java SE / [)ownloads  Java  Java EE  Java ME  Java SE Advanced & Sutte  Java Embedded  Java oa  Web Tier  Java Card  Java n,'  New to Java  Commu nty  Java Magazine  Overview  Java  Downloads  SE Do  Documentation  loads  Community  Technologies  DOWNLOAD  Java Platform (JD 10  8 NetBeans  DOWNLOAD  NetBeans With JOK 8  Jav Platform, Standard Edition  Java SE 10.0.1  Learn more  e latest feature  lease for the Java SE Platform  Java SDKs and Tools  . Java SE  • Java EE and Glassfish  Java ME  Java Card  . Netaeans IDE  Java Mission Control  Java Resou rces  Java APIs  • Technical Articles  Demos and Videos  Forums  Java Maaazjne  Develooer Trainina  • Tutorials  Javacom  Installation Instructions  Release Notes  Oracle License  Java SE Licensing Information User Ma  Includes Third Party Licenses  Certified System Configurations  Readme  Which Java package do I need?  al  JOK  DOWNLOAD  server ORE  DOWNLOAD  ORE  DOWNLOAD  Software Developers: JDK (Java SE Development ) For Java Developers Includes a  complete JRE plus tools for developing, debugging, d monitoring Java applications  Administrators running applications on a server: Se rJRE (Server Java Runtime  Environment) For deploying Java applications on serve  Includes tools for JVM  monitoring and tools commonly required for server appli tions, but does not include  browser integration (the Java plug-in), auto-update, nor a staller Learn more  End user running Java on a desktop: JRE: (Java Runtime  ronment) Covers most  end-users needs Contains everything required to run Java a lications on your system  Java SE 8'1171/ gu172  Incu es Important bug fixes Oracle strongly recomme  users upgrade to this release Java SE 8u172 is a patch-set update, in  plus additional bug fixes (described in the release notesh  Learn more  Installation Instructions  Release Notes  Oracle License  Java SE Licensing Information User Manual  s that all Java SE8  ingall of8u171  DOWNLOAD  server ORE

 

 

ORACLE  Menu  Documentation Community  Sign In v  Training  Country/Region v  Call  Oracle Technology Network / Java / Java SE / Downloads  Java  Java EE  Java ME  Java SE Advanced & Sutte  Java Embedded  Java oa  Web Tier  Java Card  Java n,'  New to Java  Commu nty  Java Magazine  Overview  Download s  Technologies  Java SE De elopment Kit 8 Downloads  Thankyou for down ading this release ofthe Platform, Standard Edition DevelopmentKit  (JDKW) The JOK is development environment for building applications, applets, and  components using  Java programming language  The JDK includes too useful for developing and testing programs written in the Java  programming langua and running on the Java platform  See also:  Java Developer N  Technology, ands  Java Developer Da  Java Magazjne  JDK8u171 checksum  JDK checksum  You must accept the  sletter: From your Oracle account, select Subscriptions, expand  cribe to Java  ands-on workshops (free) and other events  Development Kit 8u171  Binary Code License Agreement for Java SE to download this  Java SDKs and Tools  - Java SE  Java EE and Glassfish  Java ME  Java Card  Netaeans IDE  Java Mission Control  Java Resou rces  Java APIs  Technical Articles  Demos and Videos  Forums  Java Maaazjne  Develooer Trainina  Tutorials  Javacom  O  ccept License Agreement  Decline License Agreement  Product / File Description  Linux ARM 32 Hard Float  Linux ARM 64 Hard Float ABI  Linux x86  Linux x86  Linux x64  Linux xB4  Solaris SPARC 64-0it (SVR4 packaae)  Solaris SPARC 64-01t  Solaris x64 (SVR4 package)  Solaris x64  Windows x86  Windows x64  File Size  77 g7 MB  748g MB  17005 MB  18488 MB  16714 MB  18205 MB  13g 83 MB  1406 MB  g7 05 MB  leg 1 MB  20727 MB  ±jdk-8u171  ±jdk-8u171  ±jdk-8u171  ±jdk-8u171  dk-8u171  .jdk-8u171  ±jdk-8u171  ±jdk-8u171  ±jdk-8u171  ±jdk-8u171  ±jdk-8u171  öidk-8u171  -linux-arm32-ufp-hflttaraz  -linux-arm64-vfp-hflt.tarqz  -linux-i58örpm  -linux-i58&tarqz  -linux-x64T m  -linux-x6$targz  -macosx-x  -solaris-sparcßtarZ  -solaris-sparcßtarqz  -solaris-x64tarZ  -solaris-x64taraz  -windows-i58öexe  -windows-x64exe  Java SE Development Kit 8u172  You must accept the Oracle Binary Code License Agreement for Java SE to download this  software.  O  Accept License Ag reement O  Product I File Description  Linux ARM 32 Hard Float  Linux ARM 64 Hard Float ABI  Linux x86  Linux x86  Linux x64  Linux x64  Macosxx64  Solaris SPARC 64-blt (SVR4 package)  Solaris SPARC 64-01t  Solaris x64 (SVR4 package)  Solaris x64  Windows x86  Windows x64  File Size  77 MB  74 g MB  17007 MB  184 gl MB  167  18208 MB  247 87 MB  14005M8  gg 35 MB  14063 MB  g706 MB  leg 11 MB  207 3 MB  Decline License Agreement  ±jdk-8u172-linux-arm64-vfp-hflt.tarqz  ±jdk-8u172-linux-i586Tpm  ±jdk-8u172-linux-x64rpm  ±jdk-8u172-linux-x64taraz  ±jdk-8u 172-macosx-x64 dma  ±jdk-8u172-solaris-sparwgtarZ  ±jdk-8u172-solaris-sparcßtarqz  ±jdk-8u172-solaris-x64tarZ  ±jdk-8u172-solaris-x64taraz  ±jdk-8u172-windows-i58öexe  öjdk-8u172-windows-x64gxe

 

1.2、将下载好的jdk-8u171-linux-x64.tar.gz文件,上传至/tmp/目录下

 

CrootaLW_Tomcat02 tmp]# 11  total 186420  1 root root 190890122 Apr 21 10:09  CrootaLW_Tomcat02  CrootaLW_Tomcat02  Cr ootaLcw_Tomcat02

1.3、安装jdk

 

cd /tmp/

tar -zxf jdk-8u171-linux-x64.tar.gz -C /usr/local/

 

ln -s /usr/local/jdk1.8.0_171/ /usr/local/jdk

 

Cr ootaL CW_Tomc at02  /usr/l Ocal  Cr ootaL cw_Tomc at02  pwd  11  total 44  drwxr-xr-x.  drwxr -xr-x.  drwxr-xr-x.  drwxr -xr-x.  1 rwxrwxrwx  drwxr-xr-x  drwxr -xr-x.  drwxr-xr-x.  drwxr-xr-x.  drwxr -xr-x.  drwxr-xr-x.  drwxr -xr-x.  r oot  root  root  root  1  root  8  10  root  root  root  root  root  2 root  r oot  root  root  root  root  143  root  root  root  root  root  root  4096  4096  4096  4096  24  4096  4096  4096  4096  4096  4096  4096  Nov  Nov  Nov  Apr  Mar  Nov  Nov  Nov  Apr  Nov  21  28  20  2016  2016  2016  2016  10:19  20:18  2016  2016  2016  2016  00:44  2016  bin  etc  eames  Include  jdk ->  Idk1.B.O_171  lib  I-ib64  libexec  sb-in  share  src  Cr ootaL w _ Tomcat 02  Cr ootaL w _ Tomcat 02  local] #

 

1.4、配置java环境,创建/etc/profile.d/java.sh文件,并写入如下内容(注意:使用source /etc/profile.d/java.sh 让其立即生效)

 

export JAVA_HOME=/usr/local/jdk/

export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH

 

 

2.安装Tomcat

2.1、访问https://tomcat.apache.org/download-80.cgi,下载Tomcat

 

Apache Tomcat  Tomcat 8 Software Downloads  @'APACHE  Search..  CHECON  monca  September 2',-27.2018  Montréal. Canada  Apache Tomcat  Home  Taglibs  Maven Plugin  Download  Which version?  Tomcat g  Tomcat 8  Tomcat 7  Tomcat Con  Tomcat Nati  Taglibs  Archives  ectors  Documentation  Tomcat 9.0  Tomcat 8.5  Tomcat 8.0  Tomcat 7.0  Tomcat Connectors  Tomcat Native  Wiki  Migration Guide  Presentations  Problems?  Security Reports  Find help  FAQ  Mailing Lists  aug Database  Get Involved  Overview  Welcome to the Apache Tomcats 8.x software download page. This page provides download links for obtaining the  latest versions of Tomcat 8.x software, as well as links to the archives of older releases.  Users ofTomcat 8.0.x should be aware that the Tomcat team have announced the end of life date for Tomcat 8.0.x.  Users of Tomcat 8.0.x should plan to upgrade before Tomcat 8.0.x reaches end of life.  Note: End of life has been announced for 8.0.x only. 8.5.x is not affected by this announcement.  Quick Navigation  KEYS | 8.530 | 8.0.s1 1 Browse I Archives  Release Integrity  You the integrity of the downloaded files. We provide OpenPGP signatures for every release file. This  signature should be matched against the KEYS file which contains the OpenPGP keys of Tomcat's Release Managers.  We also provide SHA-I and SHA- 512 checksums for every release file. After you download the file, you should  calculate a checksum for your download, and make sure it is the same as ours.  Mirrors  You are currently using http://mirrors.tuna.tsinghua.edu.cn/apache/. If you encounter a problem with this  mirror, please select another mirror. If all mirrors are failing, there are backup mirrors (at the end of the mirrors list)  that should be available.  Other mirrors: http://mirror.bit.edu.cn/apache/  .30  PI e see the README file for packaging information. It explains what every distribution contains.  Bin Distributions  o Z, shal, sha512)  sha_l, sha512)  o tar.gz  0 32- it Windows zip (QU sha_l, shaS12)  0 64-bit Windows zip (QU sha_l, shaS12)

 

 

2.2、将下载的apache-tomcat-8.5.30.tar.gz,上传至/tmp/目录下

Cr ootaLcw_Tomcat02  /tmp  Cr ootaLcw_Tomcat02 tmp]#  total 195744  1 root root  drwxr-xr-x 2 root root  10:25  PW d  11  9541892  4096  1 root root 190890122  CrootaLw_Tomcat02  CrootaLW_Tomcat02  Tom c at E F  Apr  Apr  Apr  3 16:35  21  21  10.

2.3、安装Tomcat(多实例安装)

 tar -zxf /tmp/apache-tomcat-8.5.30.tar.gz -C /usr/local/

ln -s /usr/local/apache-tomcat-8.5.30/ /usr/local/tomcat

cd /usr/local/tomcat/

mkdir -pv /usr/local/tomcat{1,2}

mv conf/ logs/ temp/ webapps/ work/ /usr/local/tomcat1/

cp -a /usr/local/tomcat1/* /usr/local/tomcat2/

 

total 56  drwxr-xr-x  drwxr -xr-x.  drwxr-xr-x.  drwxr-xr-x.  drwxr -xr -x.  1 rwxrwxrwx  drwxr -xr -x  drwxr-xr-x.  drwxr-xr-x.  drwxr -xr-x.  drwxr-xr-x.  drwxr-xr-x.  drwxr -xr -x.  1 rwxrwxrwx  drwxr -xr -x  drwxr-xr-x  total  92  drwxr-x-  -rw-r----  r oot  total  20  total  20  drwxr-x  drwxr -x-  Cr ootaL CW_Tomc at02  pwd  /usr/l Ocal  Cr ootaL cw_Tomc at02  11  B 5.30/  Cr ootaL W_Tomc at 02  drwxr-x---  -rw-r-----  -rw-r-----  -rw-r-----  drwx------ 2  drwxr-x--- 2  drwxr-x--- 2  drwxr-x--- 7  drwxr-x--- 2  rwx------  drwxr-x--- 2  drwxr-x--- 2  -rw-r-----  -rw-r-----  4  r oot  root  root  root  root  1  root  8  10  root  root  root  root  root  root  1  root  root  7 root  r oot  root  root  root  root  root  143  root  root  root  root  root  root  root  root  root  4096  4096  4096  4096  4096  24  4096  4096  4096  4096  4096  4096  4096  32  4096  4096  Apr  Nov  Nov  Nov  Nov  Apr  Mar  Nov  Nov  Nov  Apr  Nov  Apr  Apr  Apr  21  21  28  20  21  21  21  10:45  2016  2016  2016  2016  10:19  20:18  2016  2016  2016  2016  00:44  2016  10.  10.  10.  •40  •45  •47  38  38  apache-tomcat-B. 5. 30  bin  etc  eames  Include  jdk ->  Idk1.B.O_171  lib  I-ib64  libexec  sb-in  share  src  tomcat -> /usr/local  tomcatl  tomcat2  bin  lib  LICENSE  NOTICE  RELEASE-NOTES  RUNNING. txt  apache-tomcat- .  11 tomcat/  2 root  2 root  1 root  1 root  1 root  1 root  L cw_Tomcat  root 4096  root 4096  root 57092  root 1723  root 7138  root 16246  oca  Apr  Apr  Apr  Apr  Apr  21 10.  21 10.  3 16:07  3 16:07  3 16:07  3 16:07  Tomcat % G  tomcat  root  root  root  root  r oot  root  root  root  root  root  root  root  root  root  r oot  root  root  root  root  root  4096  4096  4096  4096  4096  4096  4096  4096  4096  4096  Apr  Apr  Apr  Apr  Apr  Apr  Apr  Apr  Apr  21  21  3 16.  3 16  10.  3 16  3 16  3 16.  3 16  10.  3 16  3 16  07  : 04  • 38  : 04  : 04  07  : 04  38  : 04  : 04  conf  logs  t em p Tomcat-q51] I  webapps  work  con  logs  t emp 2  webapps  work  r ootaLcw_Tomcat02 oca #  Cr ootaLcw_Tomcat02 11 /tmp/apache-tomcat-8. 5. 30/  total  rwxr -x  -rw-r----  drwxr-x-  -rw-r-  r oot  112  drwx------ 2  drwxr-x--- 2  drwxr-x--- 2  drwxr-x--- 7  drwxr-x--- 2  1  1  1  1  root  root  root  root  root  root  root  root  root  root  r oot  root  root  root  root  root  root  root  root  root  root  root  oca  4096  4096  4096  57092  4096  1723  7138  16246  4096  4096  4096  Apr  Apr  Apr  Apr  Apr  Apr  Apr  Apr  Apr  Apr  21  21  21  10.  3 16.  10.  3 16:07  3 16  3 16:07  3 16:07  3 16:07  10.  3 16  3 16  37  07  37  : 04  37  : 04  : 04  conf  lib  LICENSE  1 oas  Tomca  NOTICE  RELEASE-NOTES  RUNNING. txt  temp  webapps  work  L cw_Tomcat  Cr ootßLCWl_Tomcat02 1

 

3、配置Tomcat启动、停止脚本

3.1、创建tomcat_sh目录,并在该目录下面分别新建start_tomcat.shstop_tomcat.sh(注意:记得给该脚本文件添加可执行权限)

mkdir -pv /usr/local/tomcat_sh

touch /usr/local/tomcat_sh/{start,stop}_tomcat.sh

 

touch , stop} _ tomcat. sh  Cr ootaLcw_Tomcat02 11 tomcat_sh/  total O  1 root root O Apr 21 21 : 54 start _ tomcat. sh  1 root root O Apr 21 21 : 54 stop_tomcat. sh  CrootaLW_Tomcat02 local] #

 

3.2、tomcat-start.sh文件内容如下:

 

#!/bin/bash

 

source /etc/profile

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

 

export CATALINA_HOME=/usr/local/tomcat

export CATALINA_BASE=${1%/}

export log=$CATALINA_BASE/startup.log

# use %/ is for next grep match

echo $CATALINA_BASE

Tomcat_PID=$(ps aux | grep "java" | grep -v "grep"  | grep "Dcatalina.base=${CATALINA_BASE}"  |awk '{print $2}')

 

if [ -n "$Tomcat_PID" ];then

    echo "The tomcat instance $CATALINA_BASE is running,please checkout the status";

    exit 1;

fi

/usr/bin/sh $CATALINA_HOME/bin/startup.sh > $log 2>&1

 

if [ "$?" = 0 ];then

    echo "The tomcat instance $CATALINA_BASE start succeed!!!";

else

    echo "The tomcat instance $CATALINA_BASE start faild!!!"

    tail -f $log

fi

 

#! /bi n/bash  source /etc/profile  PATH=/usr /local /sbi n: /usr /local /bi n: /usr /sbi n: /usr /bi n: /root/bi n  usr local tomcat  export  export  export log=  /startup. log  %/ is for next  echo  Tomcat _ PID—  echo '  /usr /bi n/sh  if C  echo '  else  echo '  tail  -f  grep matc  g rep  ' J; then  g rep  g rep  /bin/startup. sh >  ] ; then

 

3.3stop_tomcat.sh文件内容如下:

 

#!/bin/bash

 

source /etc/profile

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

 

export CATALINA_HOME=/usr/local/tomcat

export CATALINA_BASE=${1%/}

export log=$CATALINA_BASE/stop.log

# use %/ is for next grep match

echo $CATALINA_BASE

Tomcat_PID=$(ps aux | grep "java" | grep -v "grep"  | grep "Dcatalina.base=${CATALINA_BASE}"  |awk '{print $2}')

 

if [ -n "$Tomcat_PID" ];then

    /usr/bin/sh $CATALINA_HOME/bin/shutdown.sh > $log 2>&1

else

    echo "The tomcat instance $CATALINA_BASE is not running,please checkout the status"

    exit 1;

 

fi

 

if [ "$?" = 0 ];then

    echo "The tomcat instance $CATALINA_BASE stop succeed!!!";

else

    echo "The tomcat instance $CATALINA_BASE stop faild!!!"

    tail -f $log

fi

 

#! /bi n/bash  source /etc/profile  PATH=/usr /local /sbi n: /usr /local /bi n: /usr /sbi n: /usr /bi n: /root/bi n  export  export  export log=  /stop. log  e %/ is for next  echo  Tomcat _ PID—  /usr /bi n/sh  grep match  grep  ' J; then  g rep  g rep  /bi n/shutdown. sh >  else  echo '  if C  echo '  else  echo '  tail  -f  ] ; then

 

4、配置server.xml端口Tomcat1Tomcat2中的Server PortConnector PortAJP Port三者的端口必须不同)

Server Port:该端口用于监听关闭tomcat的shutdown命令,默认为8005

Connector Port该端口用于监听HTTP的请求,默认为8080

AJP Port该端口用于监听AJP( Apache JServ Protocol )协议上的请求,通常用于整合Apache Server等其他HTTP服务器,默认为8009

Redirect Port:重定向端口,出现在Connector配置中,如果该Connector仅支持非SSL的普通http请求,那么该端口会把 https 的请求转发到这个Redirect Port指定的端口,默认为8443;

 

22 < Server  <Connectoz pozt="  116  <Connectoz  7001"  onT out= " 2 0 0 0 0 "  8443"  co I = "AJP / I  8443"

 

22 < Server  <Connectoz pozt="  116  <Connectoz  7002"  onT out= " 2 0 0 0 0 "  8443"  co I = "AJP / I  8443"

 

5、创建测试文件

vim /usr/local/tomcat1/webapps/ROOT/index.html

 

<html>

<title>Tomcat1</title>

<body>

    Hello HBGSLZ! from Tomcat1.

</body>

</html>

 

vim /usr/local/tomcat2/webapps/ROOT/index.html

 

<html>

<title>Tomcat2</title>

<body>

    Hello HBGSLZ! from Tomcat2.

</body>

</html>

 

PSindex.jsp案例:

 

<%@ page language="java" %>

<%@ page import="java.util.*" %>

<html>

        <head>

                <title>JSP Test Page</title>

        </head>

        <body>

                <% out.println("Hello, world. myapp02"); %>

        </body>

</html>

 

page anguage= n %>  page u--il.<head>Test</head><bodp  <% out. world.  bodp

6、启动和停止Tomcat1Tomcat2启动:

/usr/local/tomcat_sh/start_tomcat.sh /usr/local/tomcat1/

/usr/local/tomcat_sh/start_tomcat.sh /usr/local/tomcat2/

 

trootaLcw_Tomcat02 /usr/local/tomcat_sh/start_tomcat. sh /usr/local/tomcatl/  /usr / 1 Ocal /tomcatl  The tomcat instance /usr/local /tomcatl start  succeed!!!  CrootßLCWl_Tomcat02 sh /usr/10ca1/tomcat2/  /usr /1 Ocal /tomcat2  The tomcat instance /usr/local /tomcat2 start  succeed!!!  CrootaLW_Tomcat02

 

停止:

/usr/local/tomcat_sh/stop_tomcat.sh /usr/local/tomcat1/

/usr/local/tomcat_sh/stop_tomcat.sh /usr/local/tomcat2/

 

trootaLcw_Tomcat02 localj# /usr/local sh /usr/local /tomcatl/  /usr /1 Ocal /tomcatl  The tomcat instance /usr/local /tomcatl stop succeed! ! !  CrootßLCWl_Tomcat02 /usr/local/tomcat_sh/stop_tomcat. sh /usr/10ca1/tomcat2/  /usr / 1 Ocal /tomcat2  The tomcat instance /usr/local /tomcat2 stop succeed! ! !  CrootaLW_Tomcat02  Cr ootßLCWl_Tomcat02

 

注意:如果Tomcat实例太多,切记每重启一个Tomcat实例,必须Sleep2分钟左右,具体时间依据实际情况,否则很容易出现服务正常启动,但应用无法正常访问。

 

7、使用浏览器检查测试结果(注意使用http访问)

e Tomcat I  Hello HBGSLZ!  http://  192.168.200.104:7001/  IGÄ-(A) ZE(T)  from Tomcatl.  Tomca t2  Hello HBGSLZ!  http://  192.168.200.104:7002/  from Tomcat2.

 

 

 

 

 

 

 

附:

 

1.如果需要让Tomcat实例监听在IPv4上,则需要在/usr/local/tomcat/bin/catalina.sh文件中,添加如下内容:

JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true"

 

计算机生成了可选文字: VA_OPTS="S_7AV.å—OPTS一〕彐彐.二。一〕彐彐.二。

 

修改前监听:

CrootaLcw_Tomcat02 netstat -ntulp  Active Internet connections (only servers)  O. O. 0.0  O. O. 0.0  127.0. 0.1: 7086  0.0. 0.0  Proto Recv-Q send-Q  Local Address  Forei gn  Address  tcp  tcp  tcp6  tcp6  tcp6  tcp6  tc 6  tcp6  tcp6  tcp6  tcp6  tcp6  tc 6  tcp6  tcp6  tcp6  tcp6  tcp6  tcp6  tcp6  tcp6  tcp6  tcp6  tcp6  tcp6  udp  udp6  o  o. 0.0.0:22  o  127.0.0.1:25  o  127.0. 0.1: 7083  o  127.0. 0.1: 7084  o  127.0. 0.1: 7085  o  o  127.0. 0.1: 7087  o : : :8081  : . :8086  o : : :8087  o  127.0. 0.1: 7081  o  127.0. 0.1: 7082  o  127.0.0.1:323  state  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  PID/pro ram name  756/sshä  958/master  2264/äava  2337/2 ava  2417/2 ava  2491/ 2 ava  2565 ava  2121/2 ava  2195/aava  2264/2 ava  2337/2 ava  2417/2 ava  2491 ava  756 SS  2565/äava  2121/java  958/master  2195/äava  2264/2 ava  2337/2 ava  2417/2 ava  2491/ 2 ava  2565/aava  2121/2 ava  2195/1 ava  522/chronyd  522/chronyd

 

修改后监听:

CrootaLcw_Tomcat02 netstat -ntulp  Active Internet connections (only servers)  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  O. O. 0.0  0.0. 0.0  Proto Recv-Q send-Q  Local  127  127  127  127  127  Address  0.1: 7083  0.1: 7084  0.1: 7085  0.1: 7086  0.1: 7087  o: 8082  o: 8083  o: 8084  o: 8085  o: 8086  o: 8087  o: 9081  0.1 25  o: 9082  o: 9083  o: 9084  o: 9085  o: 9086  o: 9087  Forei gn  Address  tcp  tcp  tcp  tcp  tcp  cp  cp  cp  cp  cp  tcp  tcp  tcp  tcp  tcp  tcp  tcp  tcp  tcp  tcp  tcp  tcp  tcp6  tcp6  udp  udp6  o  o  o  o  o  o  o  o  o  127  127  127  127  . O. 0.1: 7081  . O. 0.1: 7082  .0.0.1:323  state  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  LISTEN  PID/program name  1209/äava  1310/aava  1402/2 ava  1485/ aava  1559/ ava  2 ava  1157/2 ava  1209/aava  1310/aava  1402/2 ava  1485/ ava  1559/äava  1115/' ava  962/master  1157 /äava  1209/aava  1310/aava  1402/2 ava  1485/ aava  1559/aava  1115/2 ava  1157 /java  760/sshd  962/master  507 /chronyd  507 /chronyd

 

 

 

 

 

 

 

 

 


猜你喜欢

转载自blog.51cto.com/hbgslz/2120743