index.jsp 100% 410 0.4KB/s 00:00
[root@TomcatA ~]# ss -tnl
State Recv-Q Send-Q LocalAddress:Port Peer Address:Port
LISTEN 0 128 *:22 *:*
LISTEN 0 128 :::22 :::*
[root@TomcatA ~]# systemctl start tomcat
[root@TomcatA ~]# ss -tnl
State Recv-Q Send-Q LocalAddress:Port Peer Address:Port
LISTEN 0 128 *:22 *:*
LISTEN 0 100 :::8009 :::*
LISTEN 0 100 :::8080 :::*
LISTEN 0 128 :::22 :::*
[root@TomcatA ~]#
TomcatB环境配置
[root@TomcatB ~]# ifconfig
eno16777736:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.21 netmask255.255.255.0 broadcast 192.168.0.255
inet6 fe80::20c:29ff:fed8:be3b prefixlen 64 scopeid0x20<link>
ether 00:0c:29:d8:be:3b txqueuelen 1000 (Ethernet)
RX packets 839 bytes 107014(104.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 430 bytes 68356 (66.7KiB)
TX errors 0 dropped 0 overruns0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns0 carrier 0 collisions 0
[root@TomcatB ~]# cat/etc/yum.repos.d/hehe.repo
[cdrom-repo]
name=cdrom-repo
baseurl=file:///cdrom
gpgcheck=0
[aliyun-epel]
name=aliyun-epel
baseurl=http://mirrors.aliyun.com/epel/7/x86_64/
gpgcheck=0
[root@TomcatB ~]#
[root@TomcatB ~]# yum install -y tomcat
[root@TomcatB ~]# mkdir -pv/usr/share/tomcat/webapps/ROOT/WEB-INF
mkdir: created directory‘/usr/share/tomcat/webapps/ROOT’
mkdir: created directory‘/usr/share/tomcat/webapps/ROOT/WEB-INF’
[root@TomcatB ~]# vim/usr/share/tomcat/webapps/ROOT/index.jsp
[root@TomcatB ~]# cat/usr/share/tomcat/webapps/ROOT/index.jsp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<%@ page language="java" %> <html> <head><title>TomcatB</title></head> <body> <h1><fontcolor="blue">TomcatB</font></h1> <table border="1"> <tr> <td>SessionID</td> <%session.setAttribute("test.com","test.com"); %> <td><%=session.getId() %></td> </tr> <tr> <td>Createdon</td>