users@glassfish.java.net

Re: tomcat "shared" webapp with different confiurations

From: Hong Zhang <Hong.Zhang_at_Sun.COM>
Date: Tue, 06 May 2008 16:43:35 -0400

According to this blog, the Tomcat context.xml support has already been
ported to glassfish v2:
http://weblogs.java.net/blog/amyroh/archive/2007/05/context_webapp_1.html

Does that mean you can just use the same context.xml mechanism with
glassfish v2 to accomplish what you need?

- Hong

Christian Andersson wrote:

> I'm in the process of migrating over a lot of webapplicatins from
> tomcat to glassfish, and I have a question (also previously aked, but
> got no answer.
>
>
>
> 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 Context 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 ?
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>