Solved

Relative redirects: Tomcat 5 using machine local hostname instead of the FQDN from the request

Posted on 2004-09-08
4
1,206 Views
Last Modified: 2008-03-10
Hi,

I have a Jakarta Tomcat 5 server installed on a Windows 2003 Server machine (hostname labsweb1). There is a DNS entry for www.ourcompany.com pointing to the ROOT webapp on the labsweb1 server. When I go to http://www.mycompany.com/about/ for example, I get the same page as http://labsweb1/about/, except that in the web browser the URL remains http://www.mycompany.com/about/

However, if an HTTP redirect header is sent, for example from http://www.mycompany.com/goto.jsp?page=about then the URL becomes http://labsweb1/about/ instead of http://www.mycompany.com/about/

From what research I've done, this is because Tomcat is by default configured to use the machine's local hostname for resolving redirects, instead of the FQDN from the request. Any idea how to configure Tomcat so that it uses the FQDN from the request for relative redirects?

Please help if you can, thanks in advance!

-- James
0
Comment
Question by:Jeex
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 500 total points
ID: 12012278
Hi,

OK, I have had this very same issue.  My issue had nothing to do with routing... it was DNS resolution.

www.dataentry.be points to an external address which is resolved by an external name server.

If you want to get to www.dataentry.be from the inside using an internal address you need to to two things:

1.  Create a primary (master) zone on your internal name server for dataentry.be with a host record that points www to the internal address of the server.  Anything that does not resolve to any zones that you own on the internal name server will be resolved recursively (this is normally the default).

2.  Point your internal clients to your internal name server (not an external name server).

This will allow inside hosts to resolve www.dataentry.be to the internal address yet still resolve to outside sites like yahoo.com.

This will also allow outside hosts to resolve www.dataentry.be to the external address.

And................

One problem here is that if you sort out NAT & PAT so that internal clients wanting to connect to the domains you house internally will work, all of this traffic will go via the router, therefore causing an extra load on the router and slowing everything down.

I can see that the only way for you to get it working is to setup your DNS server as a caching server, but also have zones for the domains that are on your internal server. Assuming all internal clients use this DNS server.

Your DNS server won't be visible from the outside, so external DNS will still resolve your domains correctly.

Another possibility would be to use a proxy server, then on the proxy server just add www.dataentry.be to the hosts file. All clients use the proxy server for HTTP, this will also cache popular sites / files, resulting in a performance boost.

If you don't want (or don't know how) to configure DNS / Proxy, etc then you could try the "get cisco to listen on another port" as i suggested before. This can be done by doing a "ip http port 81" while in config mode. (don't forget to do a "copy runnin-config startup-config" after any changes)

i hope it may help you..
best of luck...

R.K
0
 
LVL 3

Author Comment

by:Jeex
ID: 12235279
Thanks for your help, R.K. - sorry for not accepting your answer earlier!

-- James
0
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 12235657
Hi,

No problem ... anyway you got your solution...Good..

Best of luck..

R.K
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Redirect website ! 4 52
LAMP problem identifier tool ? 9 110
Redundant SQL Servers Without Clustering 7 94
Ways to assess https/ssl websites 3 85
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now