You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Davide Bruzzone <Da...@ngt.com> on 2003/09/11 15:38:43 UTC

Tomcat and DNS...

Greetings all,

Here is a description of my problem:

- I'm running Tomcat 4.1.24 on Solaris 9. I'm hitting Tomcat directly
(i.e. I'm not going through Apache, etc.).
- I'm running a Struts-based application on Tomcat. Portions of the
application are (or are supposed to be) protected by SSL. I'm using the
Struts SSL extension (http://sslext.sourceforge.net/) to do this.
- I have a registered domain name through which I'd like to get to the
machine that's running Tomcat.
- I have set up a couple of DNS A records such that "www.foo.com" and
"foo.com" both point to the appropriate IP address.

Here's the problem:

DNS seems to be working... i.e. When I type "http://www.foo.com/" into
my (Internet Explorer) browser, the application that has been deployed
on Tomcat comes up. However, "http://www.foo.com/" is replaced with the
server's IP address in the browser's address field (i.e.
"http://www.foo.com/" is replaced with "http://xxx.xxx.xxx.xxx/").

Additionally, a portion of the site is supposed to be protected by SSL.
Since I'm using Struts and the Struts SSL extension, this is all handled
internally. However, when a form that points to a page that is supposed
to be protected by SSL is rendered by Struts, the code for the form
looks like this:

<form action="https://xxx.xxx.xxx.xxx/...

The problem with all of this is that our SSL certificate is designed to
work with "https://www.foo.com").

Here, therefore, are my questions:

- What do I need to do to get Tomcat to display the application's main
page, and not to replace the fully qualified domain name with the
server's IP address?
	- Is it an OS configuration issue? i.e. Do I need to configure
something in /etc/hosts or /etc/resolv.conf?
	- Is it a Tomcat configuration issue? i.e. Do I need to set
<Host name="www.foo.com"... in server.xml? I tried this on its own, and
it didn't work... Do I also need to set <Alias> and/or <Engine
defaultHost="www.foo.com"... Maybe this is why changing the Host name on
its own didn't work (i.e. I didn't change Engine's defaultHost).
	- Is it a DNS issue?
	- Is it a combination of these?
- How does Tomcat deal with name resolution/lookup internally?
- Does any of this have anything to do with reverse DNS lookups?

Any help/suggestions/etc. would be greatly appreciated...

Davide Bruzzone
New Global Telecom, Inc.
Golden, CO 80401
Phone: 888.648.1126
E-mail: <db...@ngt.com>
Web: http://www.ngt.com <http://www.ngt.com/> 
Building Relationships. Honoring Commitments.