0
votes

I am Using Linux rhel6 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux.

I can access tomcat from browser at port 8080. I am trying get PID of this .

I tried all the folling command but unable to fing the PID

lsof -i :8080

no output

netstat -tulpn | grep :8080

no output

also there is no log nor any httpd process running.

Please help me the find this. Thanks in advance

3
You can curl http://localhost:8080/ and the netstat command above fails? Hmm. That does many any sense at all.Christopher Schultz
This is very strange issue for me, even after shutting down the server i can access the tomcat page. I cleaned my browser settings, cookies everything even then I am able to accessit.It is also accessiable from other computers. I tried traceroute that gives * * timout message. Curl is also working.manish
Something is definitely wrong. What is the full URL are you using to access Tomcat's start page?Christopher Schultz

3 Answers

0
votes

The tomcat application uses Java so that's why there is no httpd process running:

According to the source posted below the PID is posted in a $CATALINA_PID file which means that all you need to do is read that file with (TomCat version 5 or higher)

 cat $CATALINA_PID

And that should post the PID.

Source: Is Tomcat running?

0
votes

I use to find open ports programs like this:

# lsof -i -n -P | grep LIST | grep 8080
python    10335      xxxxxxxxx    3u  IPv4 10663405      0t0  TCP *:8080 (LISTEN)
0
votes

The PID is usually defined in the init script. So you should take a look at

/etc/init.d/tomcat

Many init scripts seem to use this command for $PID:

ps aux | grep org.apache.catalina.startup.Bootstrap | grep -v grep | awk '{ print $2 }'

echo $CATALINA_PID will only return the PID if $CATALINA_PID which is not necassary the case.

source for init