Sunday, May 17, 2009

Change ROOT app in Tomcat

Recently, I tried new version of shindig - shindig-1.1-SNAPSHOT-java (http://incubator.apache.org/shindig/download/index.html). It is a reference implementation for OpenSocial 0.9 spec.

The old problem (described at http://cglreport.zhenhua.info/2009/02/shindig-server-on-tomcat.html) has not been solved.
At first I wanted to try it by deploying the war as root application in tomcat.

One easy solution is to rename the war file to ROOT.war.
I used another solution.
Steps:
Deployment:
  (1) create directory <tomcat_root>/myapps
  (2) put the war file (shindig-server-1.1-SNAPSHOT.war) to the directory created in step 1.
  (3) rename the original directory ROOT. (This step may be overlooked sometimes)
Configuration:
  (1) Add file <tomcat_root>/conf/Catalina/localhost/ROOT.xml
  (2) Content of the file is

<?xml version="1.0" encoding="UTF-8"?>
<Context
    path=""
    docBase="/globalhome/zhguo/servers/apache-tomcat-6.0.18/myapps/shindig-server-1.1-SNAPSHOT.war"
    debug="0"
    reloadable="true">
</Context>
  (3) restart tomcat

3 comments:

dr.jeffpatrick said...
This comment has been removed by the author.
dr.jeffpatrick said...

I've Tried a lot & lot with your procedure, it doesn't work for me. Can you clearly explain the 3rd step "rename the original directory ROOT". Help me in setting up this. I really do not want(no body wants) to make the ROOT.WAR or replace the tomcat ROOT directory. In real time, we may lost Tomcat admin settings and its very secured folder of tomcat. Which, I really do not want to do.

Gerald Guo said...

The 3rd step is like this:
mv ROOT ROOT.ORG
This step renames the original root directory. This is necessary because we don't want to use the original root application.