Can anybody offer any guidance or advice on how I can set up some
virtual
hosts for my application that has multiple skins.
I want to be able to go to http://flavour1 instead of having to
type in
http://longhostname/service/program.jsp?skins=flavour1, and similar
for
flavour2, flavour3, etc..
All the documentation seems to point to virtual directories, and
when I have
tried to use the syntax detailed here
http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html
http://gandhim.wordpress.com/2008/01/31/tomcat-55-virtual-directory/
http://www.experts-exchange.com/Web/Web_Servers/Apache/
Q_21242062.html
Tomcat tries to open a directory called /service/program.jsp?
skins=flavour1/
How do I phrase the context syntax correctly?
MTIA
Rob
Write a Servlet Filter that parses HttpServletRequest.getServerName()
and performs the same action that whatever handles the
"skins=flavour1"
parameter does.
In server.xml set the Engine attribute defaultHost to the single host
that will handle your application.
(This assumes that you know what you're doing re: DNS)
I use this technique and it works in Tomcat 5.5. I have multiple
domains hosted, and I name each as Aliases in the Host in server.xml.
This works unless the OP also needs to make https connections. In that
case, all of the virtual hosts will need to be in the same main domain
and a wildcard certificate will be required.
*.domain.com
vs.
www.domain1.com
www.domain2.com
If you must use https (which I do) and to have multiple domains then I
have to choose which domain has the correct certificate and the others
will not match. That wasn't too awful until Firefox 3. It is a pain.
There is no known (at least to me) solution to this except for putting
Apache in front of Tomcat and handle the certificates and virtual host
there.
Then use Filter technique to choose the appropriate skin.
I hope my remarks anticipate the next question from the OP, otherwise
I'm sorry if this a thread "hijack"
Regards,
Dave
p
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org