tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Curwen" <>
Subject Virtual Hosts and useCanonical
Date Wed, 27 Oct 2004 21:36:04 GMT
Yup, I've asked about/commented about this before.  I'm having trouble with
Vhosts, server names, and how to get the value I want out of
request.getServerName(), and this is all with apache/jk/tomcat.  (apache is
in the 2's somewhere, jk (not jk2) and tomcat 4.1.30 and 5.0.29).
"I'm only get the canonical name, help me get the alias"

"I don't care about alias, get me canonical".
So I know that both of these seem to have worked (or been doing a good
imitation of it).  But now, for the life of me, I can't get
request.getServerName() to return the canonical ServerName from httpd.conf.

apache's httpd.conf
    UseCanonicalName On
    DocumentRoot /home/data3/me20
	<Location "/WEB-INF/"> 
		AllowOverride None 
		deny from all 
	JkMount /*.jsp tomcat1 
	JkMount /login tomcat1 
    ErrorLog /var/log/test/error_log
    CustomLog /var/log/test/access_log common

tomcat1's server.xml
<Host name="" debug="0">
  <Context path=""

When I type in , I was hoping that
request.getServerName() would give me (without the www).
But it doesn't. It (jk? tomcat?) doesn't seem to honour the useCanonical
directive.  There seems to be some "controversy" about this?
Have I been going slowly crazy, and this has never worked the way I thought
it did?
mike curwen                    
intermediate programmer
globally boundless

204 885-7733  ext 227

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message