The command netstat -nlp
will show you what is listening:
]# netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:8005 0.0.0.0:* LISTEN 13940/java
tcp 0 0 0.0.0.0:8009 0.0.0.0:* LISTEN 13940/java
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 13940/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3377/sshd
The lsof
command on the pid of the tomcat process will show something similar:
java 13940 root 35r CHR 1,9 942 /dev/urandom
java 13940 root 36r CHR 1,9 942 /dev/urandom
java 13940 root 38u IPv4 31050 TCP *:8009 (LISTEN)
java 13940 root 39u IPv4 31053 TCP 127.0.0.1:8005 (LISTEN)
When you run shutdown.sh
you should see traffic go to port 8005:
[root@test001 ~]# tcpdump -i lo 'port 8005'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes
20:11:22.168395 IP test001.36696 > test001.8005: S 2859727005:2859727005(0) win 32792 <mss 16396,sackOK,timestamp 20428874 0,nop,wscale 7>
20:11:22.168922 IP test001.8005 > test001.36696: S 2855491174:2855491174(0) ack 2859727006 win 32768 <mss 16396,sackOK,timestamp 20428874 20428874,nop,wscale 7>
20:11:22.168598 IP test001.36696 > test001.8005: . ack 1 win 257 <nop,nop,timestamp 20428874 20428874>
20:11:22.171127 IP test001.36696 > test001.8005: P 1:2(1) ack 1 win 257 <nop,nop,timestamp 20428877 20428874>
20:11:22.171144 IP test001.8005 > test001.36696: . ack 2 win 256 <nop,nop,timestamp 20428877 20428877>
20:11:22.171443 IP test001.36696 > test001.8005: P 2:3(1) ack 1 win 257 <nop,nop,timestamp 20428877 20428877>
20:11:22.171453 IP test001.8005 > test001.36696: . ack 3 win 256 <nop,nop,timestamp 20428877 20428877>
20:11:22.171686 IP test001.36696 > test001.8005: P 3:4(1) ack 1 win 257
- Check that
localhost
resolves e.g. it's in /etc/hosts.
- Check that you are not running the Ubuntu Firewall.
- Post your
netstat -nlp
output if you can.
- Try
telnet localhost 8005
or telnet 127.0.0.1
Best Answer
I went around in circles on this for a while then had a DOH! moment when I realized the defaut tomcat-users.xml file has the sample list of users commented out with XML comments!