Hello,
Thanks for all the replies to my plea. I should point out that I am not
trying to do all the configuring of virtual hosts in the context.xml
file. I realize I still need the <Host> entries in server.xml, however,
I believe there is a way of specifying the context information in
context.xml that resides in the META-INF directory of the hosts .war
file. (i.e. one .war file per host, each with its own context.xml file).
I.e. I don't want to have any <Context> tags in server.xml.
I don't want to use the mod_jk approach as I think this can be done with
Tomcat alone (I've already set up iptables to reroute from 80 to 8080).
Here's the set up I imagine (a fixed size font may be needed to view the
directory structures below)...
In server.xml...
<Host name="domain1.com" appBase="?????">
</Host>
<Host name="domain2.com" appBase="?????">
</Host>
The domain1.war and domain2.war files are placed into
$CATALINA_HOME/webapps.
In domain1.war (shown as expanded by Tomcat)....
domain1 (in webapps)
|
|----------...
|----------META-INF
|-------------context.xml
In domain2.war (again, shown as expanded by Tomcat)....
domain2 (in webapps)
|
|----------...
|----------META-INF
|-------------context.xml
Where the contents of the context.xml files are as follows...
<Context path="?????" docBase="?????"/>
The problem I'm having is that I have tried every combination of
docBase, path and appBase values imaginable and always end up with a 400
not found error. Does anyone out there know what ????? should be in each
case (or am I missing attributes / tags)? Ultimately, I would like each
of the .war file's contents to be accessible via...
http://www.domain1.com
http://www.domain2.com
...by the way, this was easy on JBoss (but don't have the option to use
it here). Since JBoss uses Tomcat as it's web server, I would have
thought it would be possible with just Tomcat.
Thanks,
Matthew
Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Matt,
Matthew wrote:
...get an answer to the following:
For Tomcat 5.5.20, how do I configure virtual hosts using a context.xml
file in the META-INF directory (of each domain's .war file) as opposed
to having to do the following in server.xml....
<Host name="domain.com" appBase="" .....>
<Context path="" docBase="webapps/domain"/>
</Host>
You cannot configure virtual hosts in context.xml files.
If you want to do this, you'll probably have to write a ton of code to
make Tomcat work in a different way and install that into the server's
libraries. It's far easier to configure virtual hosts using the
configuration the way it was intended.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGASsp9CaO5/Lv0PARArvgAJ4sDL50G/IBoYDoiZ1fP7hgRUU/0QCgmhdU
coocpO6K4Vfk9b3z389+zng=
=fmuO
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]