Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed Tomcat5 on CentOS 5.3, by default tomcat runs on port 8080 but i already have ISPConfig running on that port.

Port 80 is taken up by Apache

How do I know which port tomcat is listening on ? and if required change the port.

share|improve this question

closed as off-topic by HopelessN00b Apr 3 '15 at 13:34

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 2 down vote accepted

In server.xml (usually in /etc/tomcat), there's a block starting

<Server port="xxxx">

or similar, where xxxx is the port your server is listening on, this will tell you where the server is listening. Changing the port is easy, just change this setting and restart tomcat.

Alternatively run netstat -anp and it will tell you which program is using which port.

share|improve this answer
When I do a # netstat -lnp | grep 8005 I get tcp 0 0 ::ffff: :::* LISTEN 6598/java But when I do localhost:8005 I dont get any web page, is the firewall blocking this port, if so how to enable access. – rzlines Nov 22 '09 at 18:25
That wasn't quite what i meant.. have a look at /etc/tomcat/server.xml, see what it's telling the tomcat server to run on as a port. It might not be 8005, it'll probably be 8080. If you've already got something using 8080, and it's bound, then there might be something in /var/log/tomcat/catalina.out (or catalina.log) about failed startup because the port is already used. – Tom O'Connor Nov 22 '09 at 18:28
The file is showing Server port="8005" and <Connector port="8080" and the Catalina.out is showing Address already in use:8080, I think this is used by ISPConfig as when I enter localhost:8080 in a web browser it shows the ISPconfig page. So what do I do? – rzlines Nov 22 '09 at 18:34
Change the connector to be something other than 8080, maybe 8090, restart tomcat, then test it by browsing to localhost:8090 – Tom O'Connor Nov 22 '09 at 18:54
Oh, and to get a pagewise list of anything, pipe it into less, eg, netstat -anp | less Then you can use PgUp/PgDown and so on to scroll through it – Tom O'Connor Nov 22 '09 at 18:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.