*
The moose likes General Computing and the fly likes Set tomcat for static IP. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Set tomcat for static IP." Watch "Set tomcat for static IP." New topic
Author

Set tomcat for static IP.

Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Someone asked me whether its possible to set up tomcat for public access.
I mean if I have a static IP and a computer then will this be possible to configure a tomcat in that box and access it from a internet cafe ?

Accessing it like ,

http://xxx.xx.xx.xx:8080/myapp

The above should work from an internet cafe.
Has anyone of you have tried this ?
Any special configuration required for this?

This is what I feel about it.
It should work straight out of the box , just install Tomcat and you can access it from any place in the internet.Using IP as the host name.

To make the URL look better you might want to register a domain with that static IP and then can replace the IP in the url with your registered domain name.

Please comment and advice !!
Thanks in advance.


Rahul Bhattacharjee
LinkedIn - Blog
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

It depends what is in between your local computer and this IP address.

For example, at home I have an IP address when I connect, but that IP address ends at my router. If I want a machine to respond to that IP on that port then I need to set up the router's port forwarding to that machine.

Same at work, I can set up my local machine as a server, but it can only be accessed from wiothin the office unless the admin exposes it to the outside world. Again he would do this by routing requests for some external IP/port to my machine.
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
My assumption was that all public IP's come from routers , be it static or dynamic.

I guess the only thing we might need to do is we have to enable all the incoming requests to the IP in the router of the service provider to expose my IP to the outside world and then I am ready to host.

Is it correct ?
dennis zined
Ranch Hand

Joined: Mar 07, 2003
Posts: 330
Originally posted by David O'Meara:
It depends what is in between your local computer and this IP address.

...

Same at work, I can set up my local machine as a server, but it can only be accessed from wiothin the office unless the admin exposes it to the outside world. Again he would do this by routing requests for some external IP/port to my machine.


+1.

however, if you're just hosting this at home then noip.com is your friend even if you have a router in between your pc and the internet provider. a noip client (which you have to instaull in your pc where tomcat is running) updates the dns with your router's ip address and it does this at different interval times so when your internet provider sends you a different ip, your dns is updated. of course, its very possible people accessing your site may be caught in between ip address change.

if you do decide to do this, you may have to configure port forwarding in your router (assuming use one at home) if you want your tomcat to use a different http port number.


SCJP 1.4<br />SCWCD 1.4
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Thanks Dennis and Davis for you responses.
I got it now.
 
jQuery in Action, 2nd edition
 
subject: Set tomcat for static IP.