So far everything is working fine except applications aren't auto deployed or undeployed by tomcat! I've tried this with unpacked web applications and .WAR files but no applications are deployed or undeployed without restarting Tomcat.
After all information i found on the web i'm unsure if auto deployment in userdirs is even possible. Does anyone know how to fix this problem so i don't have to restart the server everytime i make changes to my applications under ~user/public_html/... ?
This flag value indicates if new web applications, dropped in to the appBase directory while Tomcat is running, should be automatically deployed. The flag's value defaults to true. See Automatic Application Deployment for more information.
After some testing i've gathered additional information what causes web applications files in a user dir to be automatically reloaded/refreshed.
When Tomcat starts up a context is created for every user directory which has a web directory in it like public_html for example. With the admin application included in Tomcat i'm able to set the attribute "reloadable" to "true" for such a context and then everything works as expected. Every change in the user dir is noticed by tomcat and immediately visible in my browser.
But this solution doesn't work really well. First i have to set reloadable to true for every user context by hand. Furthermore changing this setting with the admin application leads to a static <Context> entry in my server.xml and i have to restart Tomcat at least once after changing this setting for all contexts.
I think what would really help me would be a possibility to tell Tomcat to create these contexts by itself with the reloadable attribute already set to true.
Any suggestions? Some other ideas? Thanks in advance!
Sorry Bill, but it also doesn't work with a correct WEB-INF/ and web.xml!
And of course you're right, i wouldn't want everybody to be able to execute arbitrary code on my server!
In fact it's for an exam where every student has to develop a web application in his personal home directory. And at the moment nobody didn't get it to work with auto deployment, so the only solution is a cronjob which restarts Tomcat every few minutes. Of course this is very annoying because you have to wait some time until you can test the result. And i simply can't believe that there isn't a better solution to this problem ;)
This is already working correctly! It get's the home directories from /etc/passwd on UNIX/Linux systems and searches for a "public_html" directory within these home directories.
Just auto deployment respectivly noticing changes in this directories doens't work automatically without restarting Tomcat. An alternative way to achieve this is to just reload the context for a user directory from the manager application. But normal users don't have access to the manager app and in spite of everything i can't believe that it is not possible to achieve what i want without manual user intervention.
Is it really that unusual what i want to do? I didn't find useful information both by crawling the web and the Tomcat docs. In fact it seems i'm the only one using this setup
I'd still be very thankful for any kind of help!
Author and all-around good cowpoke
Joined: Mar 22, 2000
Is it really that unusual what i want to do?
Yes! Running web apps for weeks without change is probably the norm.
I recently tackled the problem of adding new HttpServlet handlers without restarting Tomcat - after a long strange trip through ClassLoaders I got something working but it may not be enough for what you are trying to do because it did not provide much for static content.
It is basically a REST style web service handler using a custom ClassLoader that can load a class implementing doGet and doPost as required. You have to use reflection to actually execute the methods.