LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Tomcat: How can change root context and extracted files? (http://www.linuxquestions.org/questions/linux-software-2/tomcat-how-can-change-root-context-and-extracted-files-929857/)

Felipe 02-17-2012 03:27 AM

Tomcat: How can change root context and extracted files?
 
Hallo:

I'm beginning with the use of tomcat5/6.

Suppossing I've this:

/applications/aplication1/staticdata
/applications/aplication1/web
/applications/aplication1/web/index.html
/applications/aplication1/web/WEB-INF/web.xml
....
/opt/tomcat6/

Supponse I have a "appli1.war" for deploying.

Two questions:
1 - How can I configure Tomcat for the .war to be put in
/opt/tomcat6/webapps/
but undeploy it to
/applications/application1/web (instead of /opt/tomcat6/webapps/appli1/)

2 - How can I configure Tomcat to change root context for that application so instead of accesing with:
http://server.domain/appli1/
acces with a different root context.
Ex:
http://server.domain/application1/
or
http://server.domain/applications/appli1/
or
http://server.domain/Appli1/
(really only need one accessing way, but can change depending of the application).



Regards

Felipe 02-19-2012 05:14 PM

Reading documentation, I've found a simple way.

If may application is extracted in /applications/application1/web and I want my root context as /applications/Appli1/, there is to create a file in conf/Catalina/localhost/applications#Appli1.xml (replace each / with # and suppress first) with:
<?xml version="1.0" encoding="UTF-8"?>
<Context
docBase="/applications/application1/web"
crossContext="false"
reloadable="true" >
</Context>


All times are GMT -5. The time now is 02:07 AM.