Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

AW: Install WAR via docBase within servlet.xml

Detlev Beutner

2007-02-07

Replies:

Hi there,

It worked :-)

/conf/server.xml:

...
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
<Host appBase="webapps" name="localhost"/>
<Host appBase="webapps/myName" name="myName.server.com"/>
</Engine>
...

And within /conf/Catalina/myName.server.com/ROOT.xml

<Context path="" docBase="/path/to/some.war" debug="0">
  <Resource ... />
  <Manager ... />
</Context>

Thanks again & best regards
Detlev

>>> I have a WAR which normally should be deployed via myName.xml into
>>> /tomcat/conf/Catalina/localhost, with docBase="AbsolutePathToWar".
>>>
>>> Within that xml snippet, <Context path="/myName"
>>> docBase="/webs/web123/tomcat/application.war" debug="0"> is used.
>>>
>>> So I can call "www.server.com/myName" and it works.
>>>
>>> Now I want to call "myName.server.com" instead.
>>
>> This would mean that your webapp becomes the ROOT application of a
>> virtual host.
>
> Exactly.
>
>> As you didn't specify which version of Tomcat, I'm going to assume 5.x.
>
> Exactly, to be even more exact: 5.5.12
>
>> Place the context here:
>>  
>>  %TOMCAT/conf/Catalina/myName.server.com/ROOT.xml
>>
>> ... not in server.xml.
>
> Ahhh, that sounds as if would make sense... :-)
>
> But the HOST entry for the virtual host would have to be in server.xml
> (with no context defined), right?! Correct me if I'm wrong...


---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.