Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat starts without errors but not listening on 8080

I am running tomcat 6 on Centos 6.4 and have started it sucessfully. There were no errors on start. catalina.log reads:

2012-08-11 14:23:42,941 | INFO  | main | o.a.c.http11.Http11NioProtocol | Starting Coyote HTTP/1.1 on http-xx.xx.xx.xx-8080
2012-08-11 14:23:42,960 | INFO  | main | o.a.catalina.startup.Catalina | Server startup in 121483 ms

And ps -x shows it as running.

Unfortunately it is not responding on port 8080 however and netstat -atnp | grep LISTEN does not list it.

Any ideas of what could cause this?

like image 876
nash Avatar asked Aug 12 '12 02:08

nash


People also ask

How do you check whether port 8080 is open or not?

For instance, to check whether port 8080 is open, you would type “lsof -i :8080” in the terminal. This will show you a list of all the processes using port 8080.

How do I know if Tomcat is listening?

A simple way to see if Tomcat is running is to check if there is a service listening on TCP port 8080 with the netstat command. This will, of course, only work if you are running Tomcat on the port you specify (its default port of 8080, for example) and not running any other service on that port.


2 Answers

If the problem is that the port is not configured in iptables like Nash suggests, then you can configure it as follows:

vi  /etc/sysconfig/iptables

add the following line to the file:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

save the file on exit and restart iptables:

service iptables restart
like image 168
Nir Alfasi Avatar answered Nov 15 '22 22:11

Nir Alfasi


the answer of @alfasin is correct, but for CentOS 6 the comand line down not work

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

You need free chain one by one, this mode:

-I INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-I OUTPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-I FORWARD -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
like image 20
Luciano Marqueto Avatar answered Nov 15 '22 22:11

Luciano Marqueto