Home
TeamSite
Previewing jsps and servlets in plain ol' Tomcat
sbzoom
I would like to virtualize TeamSite to an Apache Tomcat server. There is lots of information out there for virtualization with BEA, WebLogic, Apache httpd, IIS and ColdFusion. But I need to do it with tomcat.
And not just .jsp pages. I want to virtualize a branch as an application in the Tomcat server.
So, I can setup the iw_proxy_remap and I can mount the IWServer drive from the Tomcat server. How do I make Tomcat recognize the application? Do I have to create a <context> reference for every branch and then point it to the correct directory?
Has anyone done this before? Does it seem like a simple process or a difficult one? Thanks for the help.
Whoah TeamSite!
<Charlie/>
Find more posts tagged with
Comments
Johnny
What do you mean by virtualising a branch as an application??
You will want to virtualise any workarea housing a fully contained webapp.
so in your workarea you may have a directory structure such as
/webapps/myapp/......
/webapps/myapp/WEB-INF
/webapps/myapp/......
You need to register these webapps with in Tomcat via the TeamSite mount. Each workarea that is virtualised will obviously need its own registered copy of that webapp.
This is multiplied by the number of webapps you need to virtualise.
This can be a real hassle. A light integration is to slightly rename the webapp, making them different for each workarea, running inside a single tomcat container. The other approach is to have multiple tomcat containers running, each dedicated to a specific workarea.
Once that is setup, you then need to add a proxy entry for each workarea to catch any request that should go to tomcat and rewrite it to the specific tomcat server.
Easy!!
John Cuiuli
Consultant
Sydney, Australia
sbzoom
I will try to explain what I want to do a little better and we can see just how much of a hassle it will be to setup.
/PROJECT
/PROJECT_DEV
/developer_wa
/WEB-INF
/jsp
/images
/PROJECT_INT
/contrib_wa
/WEB-INF
/jsp
/images
/templatedata
I want an app developer working in the _INT branch, they will most likely not need to virtualize since that code will be checked out into a development environment.
But the _INT branch is where my authors will work. They will use templates to update some of the jsp pages. I want these authors to be able to click on jsps and view them correctly. So I have to virtualize this workarea in Tomcat.
And, each project will get its own branch structure. I will not be keeping multiple apps in the same workarea.
So it seems that I will have to mount each specific workarea in the <tomcat-home>/conf/server.xml individually, if I want it to preview. And for each workarea that I mount, I will have to create a new regex statement for the proxy remap.
Sound about right? It does seem like quite the hassle, but I think it is the direction that I have to go in. I'm sure I can create some kind of script or workflow to do this, it will just take a while.
Let me know what you think, tell me if I am heading in the wrong direction or if I am pretty close to how it has to be done.
Whoah TeamSite!
<Charlie/>
Detention_4.txt
event_BL.png
tvaughan
How many workareas do you have under your branch?
Could you play some tricks with symbolic links in your approot that point to a WORKAREA and/or STAGING area in your branch?
Tom
sbzoom
I will most likely only have one workarea in the _INT branch. So I will either create a symlink or a <Context> inside of the server.xml. The symlink idea might be easier now that I really think about it.
But if I did want to preview the app in more than once place, I would have to give it a different name in tomcat, but the app would still work just fine. I just have to keep track of sym links and where they are pointing to.
Thanks for the suggestions. I will try them all out.
Whoah TeamSite!
<Charlie/>
Johnny
Good team work Tom!
John Cuiuli
Consultant
Sydney, Australia
Migrateduser
Which version of Tomcat? A Tomcat 3 solution is probably going to be quite different from one for Tomcat 4.
I once wrote a basic proof-of-concept integration with Tomcat 3.x. In server.xml, I pointed to a RequestInterceptor that I wrote. My RequestInterceptor examined the vpath in the URL, and if it was for an area that it had never seen before, dynamically created a webapp rooted in that area and started it up in the servlet engine.
There were unresolved issues, though, such as when to unload the webapp from the servlet engine. It could be an enormous drain on resources if you hit a large number of workareas and editions, creating a webapp for each. I believe that Tomcat 3 cannot unload or reload a webapp, making it impractical for a content webserver. Tomcat 4 should be able to support reloading, and possibly unloading as well.
I haven't tried the same exercise for Tomcat 4. If you look at the Tomcat source code, you might be able to hack something together.
-- Derek Poon, Interwoven Staff Engineer