This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Redirect or DNS alias?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 21229
137
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
raja selva
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21229
137
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Everybody's invited. Except this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!