jQuery in Action, 3rd edition
The moose likes Tomcat and the fly likes How to host website on linux server from static IP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to host website on linux server from static IP" Watch "How to host website on linux server from static IP" New topic

How to host website on linux server from static IP

Prashant Chindhade
Ranch Hand

Joined: Jan 19, 2011
Posts: 77
hi all,

I have application and I have linux system. I have one static IP which is actually a domain name for my website.
Now I want to configure linux system such that when user types my domain name in his/her browser, he/she should be able to access my web application which is actually running on linux system.
In short mapping of static ip to linux system.

thanks in advance. waiting for reply.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

You're got things a little backwards there.

The actual network configuration for a TCP/IP-based system (which is what most of them are these days) is done solely via IP addresses. Usually you'll have at least 2 of them defined for each machine, but the localhost address ( isn't visible outside of the machine itself.

To translate a domain name (such as www.coderanch.com) to the IP address that a client needs to know in order to send requests to your server, you need some sort of lookup facility. There are a number of different ones, but the one that pretty much rules the Internet is DNS (Domain Name Services). This is a "master telephone book" that handles the mapping of a name to an address. Copies of it are distributed all over the Internet.

To get your machine's name/IP address in that "phone book", you need to register it with an accredited Domain Name Registrar. There are a lot of them, including Verisign, register.com GoDaddy, various government agencies (depending on what country you live in, A lot of the hosting service companies will also handle registration. The registration is done for an incremental number of years, after which it expires and becomes fair game for whoever else wants to grab the name (so it's a good idea to renew registration before it expires).

There are several qualifications in addition to this. You cannot just pick an IP address for general Internet use. You need to get one (or more) assigned to you from an upstream provider. For home systems, this is often a dynamic address, which is another story, but if you are have a business account, you can often get a dedicated fixed address.

To use this address, you have to set up Linux networking (ask about it in our Linux/Unix forum), you have to open the port(s) you need in the router and host machine firewalls, and you should be aware that DNS does NOT include port numbers, only IP addresses, so if you have Tomcat's default ports set up, you'll need to either have to A) have user's include the Tomcat potrt number in their UTRLs, B) put a port translation or proxy service ahead of Tomcat or C) reconfigure Tomcat to run on ports 80 and 443 (not recommended, since this requires Tomcat to be root).

An IDE is no substitute for an Intelligent Developer.
Prashant Chindhade
Ranch Hand

Joined: Jan 19, 2011
Posts: 77
Hey thanks for your reply.

I got a new router and set a rule in it. if request is came from client about particular domain that router will redirect it to linux server.

I agree. Here's the link: http://aspose.com/file-tools
subject: How to host website on linux server from static IP
jQuery in Action, 3rd edition