GeeCON Prague 2014*
The moose likes Tomcat and the fly likes How to change application url? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to change application url?" Watch "How to change application url?" New topic
Author

How to change application url?

Balaji Kadam
Ranch Hand

Joined: Apr 27, 2010
Posts: 31

Hi all,
I have developed a web application which runs on url like
http://MyIP:8080/MyApplication

i want to change it like
http://MyApplication

Is it possible? or any similar way? if anybody know kindly tell.

Thank You
Balaji
Deepakkumar Devarajan
Ranch Hand

Joined: Apr 19, 2011
Posts: 54

It's not possible unless you host your web application over internet but that costs. If you give http://MyApplication,Your browser will directly look for MyApplication server over internet.


Regards,
Deepakkumar Devarajan
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16092
    
  21

There are 2 parts to this.

1. You must register a domain name, which is basically publishing an Internet "telephone listing" so that when people type in a name like "www.mousetech.com", Domain Name Services will respond with the corresponding IP address (216.199.14.18). The domain name must reside in one of the standard top-level domains (TLDs), such as ".com", ".net", or a country code like ".uk". ".in". So "MyApplication" isn't a valid domain name, but "myapplication.co.in" would be.

You own a domain name, but you also have to register one or more host names in order for a browser request to resolve to a specific IP address. For example, I have several different "mousetech.com" machines, but the choice of which machine a request gets routed to (IP address) is determined by the hostname part of the so-called fully-qualified domain name (FQDN). In the case of my primary server, that's the "www" machine, so the full URL domain name is www. mousetech.com.

2. Once you have published a FQDN with its associated IP address, the Internet can route traffic to the server machine. The DNS address contains only domain name and IP address, however, not the port number (8080).

Web browsers will send "http" requests to the target machine's port 80 (https requests get sent to port 443). That's hard-coded into the browser program, so we have to explicitly supply any alternative port (such as 8080). That's inconvenient, so a little help on the server side is required.

There are 2 ways of handling that.

A) You can reconfigure your tomcat server to serve requests at port 80 instead if its default port 8080. That's not really a good idea, however, since port IDs less than 4096 require that their owning applications have administrative privileges, which can cause security vulnerabilities.

B) You can set up a local routing mechanism that accepts port 80 requests and routes them to Tomcat's port 8080. This is often done using Apache httpd server as the front-end server and a Tomcat connector so that Apache can route to Tomcat.


Customer surveys are for companies who didn't pay proper attention to begin with.
K. Gil
Ranch Hand

Joined: Apr 29, 2011
Posts: 75

Tim Holloway wrote:
B) You can set up a local routing mechanism that accepts port 80 requests and routes them to Tomcat's port 8080. This is often done using Apache httpd server as the front-end server and a Tomcat connector so that Apache can route to Tomcat.


more details here:
http://www.coderanch.com/t/535874/Tomcat/Configure-Apache-HTTp-Server-Tomcat
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16092
    
  21

Deepakkumar Devarajan wrote:It's not possible unless you host your web application over internet but that costs. If you give http://MyApplication,Your browser will directly look for MyApplication server over internet.


Actually, not 100% true. You can publish a host/domain name as a public Internet resource, but in some cases, that's not required, such as a departmental webserver that's only accessible on a LAN to people within the company. In cases like that, there's no need for a publicly-published DNS entry, but you will need local publication. That's generally done either by using a private corporate DNS server or by manually adding entries to the users' "hosts" files on their computers.
 
GeeCON Prague 2014
 
subject: How to change application url?