[Hippo-cms7-user] Re: Running mutiple sites

Ard Schrijvers a.schrijvers at onehippo.com
Mon Feb 8 12:17:52 CET 2010


Hello Edwin,

On Mon, Feb 8, 2010 at 11:34 AM, Edwin Benneheij <ettepet at gmail.com> wrote:
> Hi Ard,
>
>> Hello Edwin,
>>
>> great you have it working, although I think you can achieve quite
>> easily what you want (unless I understand the issue incorrect) : you
>> want to have a different location of the hst:virtualhosts root folder,
>> right?
>
> No, the hst:virtualhosts root folder is fine with me.
> I just like to have a subdirectory-structure in this folder, so I can
> order all OTAP-virtualhosts for each new site:
>
> hst:virtualhosts (primary: hst:virtualhosts)
>   |
>   |- site1 (primary: ?????)
>   |     |- www-ow.site1.nl (primary: hst:virtualhost)
>   |     |- www-ts.site1.nl (primary: hst:virtualhost)
>   |     |- www-ac.site1.nl (primary: hst:virtualhost)
>   |     `  www-pr.site1.nl (primary: hst:virtualhost)
>   |
>   `  site2 (primary: ?????)
>         |- www-ow.site2.nl (primary: hst:virtualhost)
>         |- www-ts.site2.nl (primary: hst:virtualhost)
>         |- www-ac.site2.nl (primary: hst:virtualhost)
>         `  www-pr.site2.nl (primary: hst:virtualhost)
>
> With this site1- and site2- nodes it looks like the
> hst:virtualhost-nodes inside this node can't be found.

Ah, I see what you mean: but actually, I think it is much nicer than
you are currently trying :-). You can order the virtualhosts
hierarchically, where the order of the hostname is 'reverted'. So,
your setup like you have above would be much cleaner if you do it like
this (I didn't add all, but you get the idea i hope):

 hst:virtualhosts
    `  nl (primary: hst:virtualhost)
              |- site1  (primary: hst:virtualhost)
              |     |-  www-ow      (primary: hst:virtualhost)
              |     |-  www-ts      (primary: hst:virtualhost)
              |     | ....
              `- site2  (primary: hst:virtualhost)
                    |     |-  www-ow    (primary: hst:virtualhost)
                    | ....

The nice thing about this way, is that everything that is common for
the 'nl' extension, you add to the nl (primary: hst:virtualhost) (even
perhaps the default site if you want). And, you read the hostname from
last descendant up to the first  hst:virtualhost. Thus,
www-ow.site1.nl. If you want a new host, say www-new.site1.nl, you
only need to add www-new node.

Now, on each host, you only override those properties that are
different then the one from one of the ancestors. If some property is
not present, it inherits it from the ancestor.

Hope this gets you going, pls let me know if it is clear.

Regards Ard


>
>> In your hst-config.properties, you can define the root folder like this:
>> virtualhosts.repository.path = /hst:virtualhosts
>
> FYI: this is how it is, right now.
>
>
> Regards, Edwin
>
>
>> On Fri, Feb 5, 2010 at 9:44 PM, Edwin Benneheij <ettepet at gmail.com> wrote:
>>> Hey,
>>>
>>> Just to let you know what I've figured it out...
>>>
>>> In step 3 (about the virtualhosts-structure) I moved up all virtual host
>>> definitions (in sub-sub-nodes) right underneath the top virtualhosts-node
>>> (with "s").
>>> Like this:
>>>
>>> /hst:virtualhosts
>>>        |
>>>        |`www-local.currentsite.nl (hst:virtualhost)
>>>        |
>>>        `www-local.newsite.nl (hst:virtualhost)
>>>
>>> This did do the job!
>>>
>>> But I'd love to create a sub-folder-structure right beneath the
>>> hst:virtualhosts - just do divide the different sites.
>>> How can I manage this? What should be the primary type of the sub-node?
>>>
>>> Regards, Edwin
>>>
>>>
>>> On Feb 3, 2010, at 2:38 PM, Edwin B. wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>>
>>>> I'm trying (on a local system, using Jetty) to add a second site next to
>>>> the
>>>> current site, just like Ard has explained in this thread.
>>>>
>>>> STEP 1:
>>>> Looks like an easy one to me.
>>>>
>>>> STEP 2:
>>>> First, I created a new node underneath the root-node, named it
>>>> "allconfigurations" (nt:unstructured).
>>>> Second, inside this node I created two new nodes "currentsite" and
>>>> "newsite"
>>>> (both nt:unstructured. Is this right?)
>>>> Third, moved the currentsite hst:configuration into the currentsite-node.
>>>> Fourth, made a copy of the currentsite hst:configuration into the
>>>> newsite-node.
>>>>
>>>> STEP 3:
>>>> I set up this virtual-host structure like Ard described,
>>>> with:
>>>> sites (hst:virtualhost)
>>>> |
>>>> |- currentsite (hst:virtualhost)
>>>> |     `- www-local.currentsite.nl
>>>> |
>>>> `- newsite (hst:virtualhost)
>>>> |     `- www-local.newsite.nl
>>>>
>>>>
>>>> STEP 4:
>>>> Set up the live and preview hippo:docbase values for the different
>>>> hst:content and hst:configuration for both sites. They all show the blue
>>>> folder-icons to the corresponding uuid's.
>>>>
>>>>
>>>> This looks al fine to me.
>>>> Then I changed the "hst-config.properties"-file inside, like Ard mentioned
>>>> in a subsequent post:
>>>> 1. the site-project (site/src/main/webapp/WEB-INF)
>>>> 2. the site-package-project (sitepackage/src/main/webapp/WEB-INF)
>>>>
>>>> observation.sites.config.node.path = /allconfigurations  (see STEP 2)
>>>>
>>>>
>>>> Finally, i changed my local hosts file and added the two new sites:
>>>> 127.0.0.1     www-local.currentsite.nl
>>>> 127.0.0.1     www-local.newsite.nl
>>>>
>>>>
>>>> Then I started up the site and browsed to the two sites:
>>>> www-local.currentsite.nl and www-local.newsite.nl
>>>>
>>>> Both sites show a page with two URL's: preview and live.
>>>> Clicking on these hyperlinks generate a  404 - page not found, for both
>>>> the
>>>> current and the new site.
>>>>
>>>>
>>>> Where did I go wrong?
>>>>
>>>> Regards,
>>>> Edwin
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://n2.nabble.com/Running-mutiple-sites-tp4050316p4507183.html
>>>> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
>>>> _______________________________________________
>>>> Hippo-cms7-user mailing list and forums
>>>> http://www.onehippo.org/cms7/support/community.html
>>>
>>> _______________________________________________
>>> Hippo-cms7-user mailing list and forums
>>> http://www.onehippo.org/cms7/support/community.html
>>>
>> _______________________________________________
>> Hippo-cms7-user mailing list and forums
>> http://www.onehippo.org/cms7/support/community.html
>>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/community.html
>



More information about the Hippo-cms7-user mailing list