• Uncategorized

About linux : Not-able-to-find-port-number-for-tomcat-process-on-Ubuntu

Question Detail

I am not able to find a port number for running Tomcat server on Ubuntu
i.e. netstart -anp | grep 'tomcat' but not getting any output.

Question Answer

You will want to grep for java and not tomcat, as the process binary is java and not Tomcat.

If you’d like to find the PID for the process to make things easier (e.g. if you have lots of Java processes on the server), you can do this:

ps aux | grep catalina

This will show you your various Tomcat processes. Each one will have a system property on the command-line like this:

-Dcatalina.base=/path/to/your/tomcat

Note that there is also catalina.home which may be different. If they are different, it is catalina.base which is the correct one, which contains your server’s conf/server.xml which controls the server.

Once you have that PID, you can netstat -plan | grep [PID] to get your port number.

Or just look in /path/to/your/tomcat/conf/server.xml for any <Connector> elements, each of which should have a port specified.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.