Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Say I have a virtual host set up in Tomcat for "mydomain.com" and I want to direct my sub-domains to particular contexts in the virtual host. For example...

issues.mydomain.com would take you to www.mydomain.com/jira
wiki.mydomain.com would take you to www.mydomain.com/xwiki
vcs.mydomain.com would take you to www.mydomain.com/svn

...and so on.

I'm hoping there's a slick way to do this, perhaps with the <Alias> tag without having to create a virtual host for every sub-domain I want to handle. Or if there's a completely different solution, I'm all ears.

Thanks!

share|improve this question
add comment

1 Answer 1

Use httpd apache in front of your Tomcat!

That way you could use a named virtual host and direct it to your Tomcat-Application. It is also more secure since you can forbid any other path within that VHost.

You also don't have to expose your Tomcat to the network at all: Bind it to localhost and use mod_jk or mod_proxy_ajp (the first ist better suited for heavy load) to connect to Tomcat via AJP (normally TCP 8009).

share|improve this answer
    
Thanks for the reply, Nils, but those answers are outside the bounds of my question. –  Syndog Jul 18 '11 at 11:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.