tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: please help me how i can test that whether tomcat is up and running on a remote machine from a client machine.
Date Thu, 22 Sep 2011 12:16:33 GMT
vishveswara chary varanasi wrote:
> Tomcat community has a wiki which providded the
> http://wiki.apache.org/tomcat/HowTo#How_do_I_check_whether_Tomcat_is_UP_or_DOWN.3F_There_is_no_status_command
> 
> i have tried to connect to tomcat using sockect connection on the port
> where the tomcat running
>

which is ?

>  Socket socket = new Socket("hostname", port);
> 

What is "hostname" in your case ? can the client resolve this name to an IP address 
corresponding to the Tomcat host ?

> this works some time and some time even if the tomcat is up and
> runnning this is throwing the java.net.ConnectException: Connection
> timed out: connect.
>

When does it work and when not ?

> please help me how i can test that whether tomcat is up and running on
> a remote machine from a client machine.
> 

Read this carefully : http://tomcat.apache.org/tomcat-7.0-doc/config/server.html
(all of it, but particularly the "address" attribute).

Unless I am mistaken, it means that by default Tomcat only listens, on that port, on the 
address "localhost", which usually is the IP address 127.0.0.1.
In other words, by default this will only work from a client running on the same host.

By using e.g. : address="0.0.0.0"
you could tell Tomcat to bind this listening socket to all the IP addresses of the Tomcat

host.  But then, you have to be extra careful not to allow just any client to stop Tomcat,

just by connecting to that IP/port and sending "SHUTDOWN".

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message