Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
28
rated 0 times [  28] [ 0]  / answers: 1 / hits: 102719  / 3 Years ago, tue, september 28, 2021, 1:10:01

I have installed a package called opengeo-suite which installs tomcat 6 if it is not installed. Now I have apache 2.2 running on port 8080. I wish to find out on which port is the tomcat 6 running on? What is the command to find that out?



EDIT



Also how do I identify whether it is up and running?


More From » apache2

 Answers
6

If you use



$ ps -ef


or



$ top


you should be able to find the PID (Process ID) for your opengeo-suite.



With the PID in hand, you can use netstat and grep to find out what port it's running on. For example, I can see the PID of my tomcat is 1483. So using,



$ sudo netstat -lnp | grep 1483


I get the result:



tcp6       0      0 :::8080                 :::*                    LISTEN      1483/java       
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 1483/java


I don't think you asked this, but for completeness, to find the process ID when you know port number:



$ sudo lsof -i:8080 -n


gives



COMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java 1483 tomcat6 36u IPv6 3496 0t0 TCP *:http-alt (LISTEN)


Note, netstat and lsof will run without sudo, but they won't show all ports. In my case, sudo was necessary to see the tomcat ports.


[#38024] Tuesday, September 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lasagnerhead

Total Points: 487
Total Questions: 105
Total Answers: 122

Location: French Southern and Antarctic Lands
Member since Sun, May 3, 2020
4 Years ago
;