Hi Nick,
The repository mapping idea sounds interesting, although I don't know
enough about it to know if it would work so hopefully someone else can
give some feedback on this. The module idea won't help you I think -
the content from the samples module just gets included in the main
website repository, so the result is no different to adding a new node
to the site manually. You might be able to combine the 2 ideas though,
and create your additional site repository as part of a module.
The alternative approach I've seen most often, and that we use
ourselves, is to create top level nodes for each site, and then use
apache mod_rewite to map different domains to the correct subnode. The
mod_rewite directives we use for each site are as follows:
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteCond %{REQUEST_URI} !^(.*)site1(.*)$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/site1$1
We map all the domains as aliases to the magnoliaPublic webapp, which
runs off the root of a virtual host in our case to avoid having
magnoliaPublic in the URLs. When a request is made for one of the
domains, the rewite rule then adds on the relevant top-level node for
that site's content.
This works fairly well, and means you can request deep links from the
site, and they will always work. The only problems with it are:
- Although the rewrite rule should be transparent, and not do a hard
redirect, the full domain is always visible in the browser. It seems
like something internal in tomcat or magnolia is doing the hard
redirect, which would be nice to fix if anyone knows how.
- Any links within the site will point to the full URL, with the extra
node. This could be fixed with a new version of the navigation tag,
and some changes to the fckEdit save process for links in content, but
we haven't done that yet.
Hopefully this is of some use. If not then hopefully someone can come
up with a better way that will help us all :-)
Simon
On 19/04/07, Nicholas Orr <[email protected]> wrote:
==== 1st Idea ====
-- Multiple Websites in one instance of Magnolia using a separate
repository for each site --
I've been reading lots, doing things in the wiki and I'm wondering.
Would it be possible (a good way to do it) to create multiple
repositories per website you want in Magnolia?
Looking at the Server Node there is a folder "URI2RepositoryMapping".
Based on what is there would it make sense that you could have the
following setup?
F=Folder,CN=Content Node, ND=Node Data
F-server
+F-URI2RepositoryMapping
+-CN-site1
+--ND-URIPrefix=site1
+--ND-handleprefix (what is this??)
+--ND-repository=site1
+-CN-site2
+--ND-URIPrefix=site2
+--ND-handleprefix (what is this??)
+--ND-repository=site2
Then you'd have to go through the modules-adminInterface and add a
whole bunch of config to map everything in Admin Central.
Plus if everything was built off "siten/" you'd be able to do
everything like it was just "/" wouldn't you? Like navigation menus
and such...
==== 2nd Idea ====
-- Use a module per site --
Since the sample module is all self contained would it be possible to
just do each site in its own module? But then it has to map to its own
website management area....
=============================
I've tried following
http://www.magnolia.info/wiki/Wiki.jsp?page=RunningSeveralSitesWithOneMagnoliaInstance
But that gives crap URL's
http://www.domain.com/site1/index.html
I need multiple sites with clean urls
http://www.domain.com/index.html
Doing mod_proxy requests I've noticed there are mappings to
/site1/index.html which don't work because one you expand that you get
http://www.domain.com/site1/index.html which doesn't work with
mod_proxy because an extra site1 is put in there -
http://www.domain.com/site1/site1/index.html
==============================
This seems like a common thing to do, yet there is no clear answer on
how to do it. If there is I haven't found it yet. Please point me in
the correct direction, please please please please!!!
If I had the time I'd sit here and work it all out on my own, I need a
CMS up and running asap. I could probably achieve what I want to do
using a PHP solution as those don't sit in memory waiting for things
to happen so having multiple instances is no biggie. Just create a dir
dump the files and configure. Need a new cms site, copy-paste-modify.
But then the PHP solution is harder for me to massage into shape
because I'm not as familar with PHP as I am with Java. Plus Java tends
to be more organised, includes aren't all over the place and you can
follow imports better...
Nick
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------