users@glassfish.java.net

tomcat "shared" webapp with different confiurations

From: Christian Andersson <ca_at_ofs.no>
Date: Fri, 25 Apr 2008 09:04:58 +0200

this is my third question.

With tomcat I have been able to setup many webapplications that use the
SAME directory for the webapplication but use different configuration.
is this possible with glassfish?

Let me explain what I have done..

I have a small webbaplication that several customers use. I would like
to be able to host this webapplication like this..

http://www.example.com/customer1
http://www.example.com/customer2
http://www.example.com/customer3
http://www.example.com/customer4


now IN tomcat, I can do that using the same webapplication directory and
then in my [TOMCAT-INSTALL-DIR]/conf/Catalina/example.com/ directory I
can setup Contxt configuration files

customer1.xml
customer2.xml
customer3.xml
customer4.xml

in these different context files I do stuff like this..

<Context docBase="/var/tomcat/shared/webapplication">
   <Parameter name="ConfigurationPath"
value="/var/tomcat/config/[COMPANY-NAME]/" override="true"/>
   <Realm className="org.apache.catalina.realm.JNDIRealm"
          connectionURL="ldap://localhost:389"
          debug="99"
          roleBase="ou=Roles,[COMPANY-DN]"
          roleName="cn"
          roleSearch="(uniqueMember={0})"
          userPattern="uid={0},ou=People,[COMPANY-DN]"/>
</Context>

(the [] parts in the context file is not written like that in the real
files but is changed depending on customer..


This type of configuration means that IF I upate an file in
/var/tomcat/shared/webapplication (jsp/jar, etc) ALL my customers get
that change, for an administrative point this is much easier then having
to do the same change for all customers..

now, I could probably been able to do that with a war file and some
scripts, but I don't have that and I like to use an directory structure.


I think I read an comparison of tmcat and glassfish (v1 something of
glassfish) and I think it said that this was not possible, but glassfish
is now v2 and this might have changed.

so is this kind of configuration possible using glassfish v2 ?