Login  Register

RE: Multiple webapps on virtual hosts

Posted by Ravish Kamath on Sep 15, 2006; 7:15am
URL: http://ofbiz.116.s1.nabble.com/Multiple-webapps-on-virtual-hosts-tp141863p141865.html

Chris/Venkata,

Here is the set-up we attempted based on your suggestions:

Based on Venkata's suggestion
-----------------------------

Images component - ofbiz-component.xml

    <webapp name="images"
        title="Images"
        server="default-server"
        location="webapp/images"
        mount-point="/images"
        app-bar-display="false">
        </webapp>

    <webapp name="images"
        title="Images"
        server="default-server"
        location="webapp/images"
        mount-point="/images"
        app-bar-display="false">
                <virtual-host host-name="www.def.abc.com"/>
        </webapp>

Ecommerce component - ofbiz-component.xml

            <webapp name="ecommerce"
        title="ECommerce"
        server="default-server"
        location="webapp/ecommerce"
        mount-point="/ecommerce"
        app-bar-display="false">
        </webapp>

    <webapp name="nqcommerce"
        title="Nasdaq ECommerce"
        server="default-server"
        location="webapp/nqcommerce"
        mount-point="/nqcommerce"
        app-bar-display="false">
                <virtual-host host-name="def.abc.com"/>
        </webapp>

Result:

http://localhost:8080/ecommerce/control/main - works fine with all static
resources being accessed

http://def.abc.com/ecommerce/control/main - returns 400 bad request,
response code.

Based on Chris's suggestion
---------------------------

Images component - ofbiz-component.xml

    <webapp name="images"
        title="Images"
        server="default-server"
        location="webapp/images"
        mount-point="/images"
        app-bar-display="false">
                <virtual-host host-name="abc.def.com"/>
                <virtual-host host-name="localhost"/>
        </webapp>

Ecommerce component - ofbiz-component.xml

    <webapp name="ecommerce"
        title="ECommerce"
        server="default-server"
        location="webapp/ecommerce"
        mount-point="/ecommerce"
        app-bar-display="false">
        </webapp>

    <webapp name="nqcommerce"
        title="Nasdaq ECommerce"
        server="default-server"
        location="webapp/nqcommerce"
        mount-point="/nqcommerce"
        app-bar-display="false">
                <virtual-host host-name="abc.def.com"/>
        </webapp>

Result:

http://localhost:8080/ecommerce/control/main - returns 400 bad request,
response code

http://def.abc.com:8080/nqcommerce/control/main - returns 400 bad request,
response code

It would seem like, virtual-host is mapped to a single webapp. i.e. the
relationship is one-to-one. Are there anyother steps I can try out ?

thank you,
ravish

-----Original Message-----
From: G.Venkata Phanindra [mailto:[hidden email]]
Sent: Friday, September 15, 2006 10:51 AM
To: [hidden email]
Subject: Re: Multiple webapps on virtual hosts


Hi,
We too had a similar Problem, One of the Hack or a work arround we found was
to define one more images Instance of images by adding

    <webapp name="images"
        title="Images"
        server="default-server"
        location="webapp/images"
        mount-point="/images"
        app-bar-display="false">
        <virtual-host host-name="hostname"/>
    </webapp>
But we r creating two instances of images.
Phani

On 9/15/06, Ravish Kamath <[hidden email]> wrote:

>
> All,
>
> We have a store set-up on Ofbiz, lets say
> www.abc.com/ecommerce/control/main. As a next step we are looking at
> launching another store targetted at a sub-vertical within the abc space
> with a different view/catalog running of the same instance. The new store
> should be accessible @ www.def.abc.com/defecommerce/control/main. The
> following are the steps we followed:
>
> a) Created a new Store
> b) Created a new website and associated the store created in step a with
> this site.
> c) Replicated the ecommerce webapp and renamed it as defecommerce.
> d) Altered the ofbiz-component.xml and added the following entry:
>
>     <webapp name="defecommerce"
>         title="Def ECommerce"
>         server="default-server"
>         location="webapp/defecommerce"
>         mount-point="/defecommerce"
>         app-bar-display="false">
>                 <virtual-host host-name="www.def.abc.com"/>
>         </webapp>
>
> e) Edited the web.xml under WEB-INF, to point to the new website id.
> f) On restarting the ofbiz instance, while both the ecommerce instances
> can
> be accessed, the static resources served out of the images component, are
> not being served for the defecommerce webapp. Access logs show that all
> static resource fetch requests have received http 400 error code response.
> Would this means that all static resources need to be served out of the
> same
> webapp, defecommerce ?
>
> TIA,
> ravish
>
>


--
G.Venkata Phanindra
Mob:: 9849852989