Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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:127.0.0.1:8005 :::* 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
1  
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 java.net.BindException: 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
1  
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
1  
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
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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