aspose file tools*
The moose likes Tomcat and the fly likes Redirect or DNS alias? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Redirect or DNS alias?" Watch "Redirect or DNS alias?" New topic
Author

Redirect or DNS alias?

raja selva
Greenhorn

Joined: Jul 14, 2010
Posts: 6
I am using apache-tomcat-6 as a web server.
I have a index.jsp, I want to create a DNS alias so when user enter like

http://abc.com
http://abc
http://otheralias
--> it all will direct to http://abc.com

How do I set this up? What do I do in the index.jsp or in the server.xml?

Usually if i access my local then i type
https://localhost:7070/works --> then I get into the first page index.jsp
so in the same token: I want to type www.mymachine.com ---> it redirect me to http://localhost:7070/works

Please giving more help or assist.


Thank in advance
selva
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

Tomcat does not supply DNS services. The client has to obtain them from a DNS server.

Most common web browsers will take a simple name like "abc" and expand it to "www.abc.com". DNS servers will sometimes contain extra information to assist in finding a default fully-qualified domain name when given a partial domain name. They also support alternate (alias) names for servers.

So for all of your examples, a properly configured authoritative DNS server will handle all of your URLs and Tomcat doesn' get involved.


Customer surveys are for companies who didn't pay proper attention to begin with.
raja selva
Greenhorn

Joined: Jul 14, 2010
Posts: 6
Thanks for replay.

But Most of application has using production on the tomcat server. Right?

ok. How can i resolve these issues?

I want to type www.mymachine.com ---> it redirect me to http://localhost:7070/works

Thanks,
selva


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

DNS converts domain names to IP addresses, but it doesn't do ports. So unless a user provided an explicit port ID, their web browser would assume port 80 for http or port 443 for https.

To redirect internally to localhost:7070 - which normally is a WebLogic server (not Tomcat), you'd do something like use Apache HTTP server as a frontend. You can set up an ajp proxy rule in apache that will take URLs addressed to the Apache server on ports 80 and 443 and redirect them to localhost:8009, which is Tomcat's HTTP port.

Then again, if you're actually running WebLogic, Tomcat ajp proxying wouldn't work and you need to either go back to the WebLogic documentation or ask about it on our WebLogic forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirect or DNS alias?