You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rashmi <ra...@gmail.com> on 2008/02/20 04:30:32 UTC

Accessing standalone Tomcat from an external IP address

Hello,

I'm trying to configure Tomcat so that it can be accessed externally.

The environment is Tomcat 6.0, Fluxbuntu 7.10, JavaSE6.

The connection works locally , for example if I try
http://localhost:7070/ or http://127.0.0.1:7070/ I can see the app,
but if I try with the external ip address and the same port for
example:

http://xxx.xxx.xxx.xxx:7070 , I can't access the app, I get a "The
server at external ip is taking too long to respond."

I read the HTTP Connector documentation :
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html

It also appears that the router is forwarding the connection from the
external ip address correctly because If I do a netstat -tupan , on
the Linux command line it shows that the connection from the external
ip
address was received correctly, but Tomcat isn't reponding to it.

I searched everywhere but couldn't find an answer.

Should I configure the HTTP connector differently? Currently the HTTP
connector configuration is the one that comes by default with Tomcat
6.x. I'm pasting it here for reference:

    <Connector port="9090" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

Any help is appreciated.

-Rashmi

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


Re: Accessing standalone Tomcat from an external IP address

Posted by Rashmi <ra...@gmail.com>.
Hi Chris,

You are right about the ports, thanks for pointing it out. I made sure
the ports were matching on the system, but when I typed it I specified
it incorrectly.

I got this to work, it was the Linux firewall issue, I had to
configure iptables and forward requests coming in from the external ip
address to the internal ip address,
and send responses from internal ip to external ip.

After the configuration was made the request was reaching Tomcat and
it served the request like it always does.

-Rashmi

On Wed, Feb 20, 2008 at 2:09 PM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
>  Hash: SHA1
>
>  Rashmi,
>
>
>  Rashmi wrote:
>  | http://localhost:7070/ or http://127.0.0.1:7070/ I can see the app,
>  | but if I try with the external ip address and the same port for
>  | example:
>  |
>  | http://xxx.xxx.xxx.xxx:7070 , I can't access the app, I get a "The
>  | server at external ip is taking too long to respond."
>
>  [snip]
>
>
>  |     <Connector port="9090" protocol="HTTP/1.1"
>  |                connectionTimeout="20000"
>  |                redirectPort="8443" />
>
>  Is the port "9090" up there a typo? If TC is listening on port 9090,
>  then it certainly won't respond to requests on port 7070.
>
>  - -chris
>  -----BEGIN PGP SIGNATURE-----
>  Version: GnuPG v1.4.8 (MingW32)
>  Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
>  iEYEARECAAYFAke8etAACgkQ9CaO5/Lv0PC7oQCfUD+vtV9EedVN9XTA7n2rZfi/
>  dEoAnjWyAD1vlsykjkVIMyDozbWCt+au
>  =FROn
>  -----END PGP SIGNATURE-----
>
>
>
>  ---------------------------------------------------------------------
>  To start a new topic, e-mail: users@tomcat.apache.org
>  To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: Accessing standalone Tomcat from an external IP address

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rashmi,

Rashmi wrote:
| http://localhost:7070/ or http://127.0.0.1:7070/ I can see the app,
| but if I try with the external ip address and the same port for
| example:
|
| http://xxx.xxx.xxx.xxx:7070 , I can't access the app, I get a "The
| server at external ip is taking too long to respond."

[snip]

|     <Connector port="9090" protocol="HTTP/1.1"
|                connectionTimeout="20000"
|                redirectPort="8443" />

Is the port "9090" up there a typo? If TC is listening on port 9090,
then it certainly won't respond to requests on port 7070.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAke8etAACgkQ9CaO5/Lv0PC7oQCfUD+vtV9EedVN9XTA7n2rZfi/
dEoAnjWyAD1vlsykjkVIMyDozbWCt+au
=FROn
-----END PGP SIGNATURE-----

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


Re: Accessing standalone Tomcat from an external IP address

Posted by Rashmi <ra...@gmail.com>.
Hi Chuck,

Thank you for your reply, it is helpful to know that no further
configuration is required in server.xml to make Tomcat accessible
through an external IP.

As you mentioned I may need to configure the firewall as described
here: https://help.ubuntu.com/6.06/ubuntu/serverguide/C/firewall-configuration.html

The netstat tool shows that the connection was received from the
external IP. Since the request is not reaching Tomcat , I guess the
request is not being frowarded from the external to the internal ip. I
checked Tomcat's access log valve outputs, and it shows that no
connection was received. This is not related to Tomcat. I'll try to
figure this out.

-Rashmi

On Tue, Feb 19, 2008 at 10:36 PM, Caldarale, Charles R
<Ch...@unisys.com> wrote:
> > From: Rashmi [mailto:rashmi.sub@gmail.com]
>  > Subject: Accessing standalone Tomcat from an external IP address
>
> >
>  > I'm trying to configure Tomcat so that it can be accessed externally.
>
>  There's nothing to configure within Tomcat for that.
>
>
>  > http://xxx.xxx.xxx.xxx:7070 , I can't access the app, I get a "The
>  > server at external ip is taking too long to respond."
>
>  You likely have a firewall blocking remote access.
>
>   - Chuck
>
>
>  THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
>  MATERIAL and is thus for use only by the intended recipient. If you
>  received this in error, please contact the sender and delete the e-mail
>  and its attachments from all computers.
>
>  ---------------------------------------------------------------------
>  To start a new topic, e-mail: users@tomcat.apache.org
>  To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


RE: Accessing standalone Tomcat from an external IP address

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Rashmi [mailto:rashmi.sub@gmail.com] 
> Subject: Accessing standalone Tomcat from an external IP address
> 
> I'm trying to configure Tomcat so that it can be accessed externally.

There's nothing to configure within Tomcat for that.

> http://xxx.xxx.xxx.xxx:7070 , I can't access the app, I get a "The
> server at external ip is taking too long to respond."

You likely have a firewall blocking remote access.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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