You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Narayanaswamy, Mohan" <Mo...@in.standardchartered.com> on 2006/11/30 05:47:31 UTC

Request.getServerName() - Configuration

Dear All,

How to configure request.getServerName() to return based on the url?

----------

Could someone of you help me to find all the combination (Tomcat 4.1.x +
mod_jk + Apache) of configuration for server name value.

We have following configuration in the server.

In httpd.conf
ServerName sampleserver.com:80

<VirtualHost _default_:443>
ServerName sampleserver.com:80
</VirtualHost _default_>

But I am accessing application using "MyServer.com" (I have entry for
MyServer.com in hosts files), But When I access the application using
http://MyServer.com/jsp/showparam.jsp - it's request.getServerName()
returns sampleserver.com. 

How can I force tomcat to return MyServer.com instead of
sampleserver.com for request.getServerName().

-----------

Because there is one more setup available, where it exactly returns
based on the requested domain, It returns request.getServerName value as
MyServer.com, all the configurations are same (httpd.conf, server.xml
are similar).

Regards,
Mohan


This email is confidential. If you are not the addressee tell the sender immediately and destroy this email
without using, sending or storing it. Emails are not secure and may suffer errors, viruses, delay,
interception and amendment. Standard Chartered PLC and subsidiaries ("SCGroup") do not accept liability for
damage caused by this email and may monitor email traffic.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org