Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Possible to map subdomains to webapps in a standard Java app server?

0

68 views

If you have two webapps, foo and bar, in a J2EE app server like Tomcat, the normal way to distinguish them is like this:

domain.com/foo
domain.com/bar

I'd like to do this instead:

foo.domain.com
bar.domain.com

Is this possible?

asked January 27, 2011 3:28 pm CST
posted via StackOverflow

3 Answers

0
 

You can define separate JkMount directives in two separate files. Then configure each subdomain as a separate virtual domain, and include the appropriate config file with the JkMount for that subdomain.

answered January 27, 2011 4:23 pm CST
0
 

You need to use 2 entries in server.xml - then each webapp will be the ROOT webapps for each virtual host.

answered January 27, 2011 5:47 pm CST
0
Best answer
 

It's not something that can be done in a "standard" way - each Java app server has different ways of configuring itself. You will need to look at the documentation for which-ever server you want to deploy to.

For Jetty, that documentation is here: http://wiki.eclipse.org/Jetty/Howto/Configure_Virtual_Hosts

answered January 30, 2011 7:19 pm CST
Tim

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions
Small server using java?
January 11, 2011
Java HTTP Server Library
January 21, 2011
Subdomains of *
January 24, 2011