tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: adding a global URI prefix for Tomcat web apps
Date Tue, 17 Apr 2012 23:01:59 GMT
2012/4/18 ron.vandenbranden@home <ron.vandenbranden@kantl.be>:
> Hi,
>
> Sorry if I'm being a bit dense, but could I check if I'm understanding
> correctly? I can't get it working with your suggestions.
>
>
> On 18/04/2012 0:04, Konstantin Kolinko wrote:
>>
>> 2012/4/17 ron.vandenbranden@home<ron.vandenbranden@kantl.be>:
>>>
>>>    2. change ${CATALINA.HOME}/conf/server.xml as follows:
>>>
>>>    <Host name="localhost"  appBase="webapps" unpackWARs="true"
>>> autoDeploy="false" deployOnStartup="false">
>>>      <Context path="/apps/my_app" docBase="/my_app/" reloadable="true"/>
>>>    </Host>
>>>
>> More comment on the above, as you have already read the docs.
>>
>> Putting<Context>  element into server.xml is considered a bad practice.
>>
>> Instead of that you'd put it into separate XML file,
>> conf/Catalina/localhost/apps#my_app.xml
>> as
>> <Context docBase="/docbase/of/my_app/" />
>>
>> That "reloadable="true"" is not really needed.
>>
>> Your docbase can be anywhere (outside of webapps directory) and need
>> not have the '#' sign in it.
>>
>> The working folder for your app will still be
>> ${catalina.base}/Catalina/localhost/apps#myapp with a hash char in it,
>> but I think that will work with Cocoon.
>
>
> I have my webapps located at F:\tomcatApps (so outside of the catalina
> tree), where 'my_app' lives in a folder named 'apps#my_app'.

1. Rename the folder to "my_app".
So it is F:\tomcatApps\my_app

> So I'm
> specifying this in ${catalina.base}/conf/server.xml:
>
>   <Host name="localhost" appBase="F:/tomcatApps" unpackWARs="true"
> autoDeploy="false" deployOnStartup="false">
>

2. It should be appBase="webapps", like Chuck noted!

3. deployOnStartup="true", like you already figured it.


> ...without any further <Context> elements.
>
> Next, I create following file at
> ${catalina.base}/conf/Catalina/localhost/apps#my_app:

Correct place, the name:
apps#my_app.xml

(you omitted ".xml" extension in your mail, but it seems it was just a typo)

>
>  <Context docBase="/my_app/" />
>

<Context docBase="F:\tomcatApps\my_app" />

> (as I understand from the docs that the @docbase value must be relative to
> the Host's @appBase).
>
> When I start Tomcat with these settings, no webapps are deployed at all. I
> tried toggling the values for @autoDeploy and @deployOnStartup, and only the
> latter seems to make any webapps to be deployed. Yet, the Tomcat console
> window then logs following message:
>
>  INFO: Deploying configuration descriptor
> F:\tomcat-7.0.27\conf\Catalina\localhost\apps#my_app
>  18-apr-2012 0:37:56  org.apache.catalina.startup.HostConfig
> deployDescriptor
>  WARNING: A docBase F:\tomcatApps\my_app inside the Host appBase has been
> specified, and will be ignored
>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message