aegir in a directory

Events happening in the community are now at Drupal community events on www.drupal.org.
enboig's picture

I want to create subsites for all my association groups; so under my main drupal installations I created a ".../groups/" directory and each group should have its name under "/groups/..."

An example would be:

/ => mail site
/groups/hostmanager => admin site
/groups/g1 => first group
/groups/g2 => another group
......

The diferent groups share users and some other tables.

Would aegir help me to do this? I tried installing it but I cannot do so:

* (Currently using Document root Drupal has been installed in a subdirectory. You will need to modify your virtual host configuration to point a ServerName directly at the installation path.)
* Provision may only be installed as the default site in a Drupal installation. It is currently installed in the "sites/www.escoltesiguies.cat" directory. Please move this directory to "sites/default". (Currently using Configuration path sites/escoltesiguies.cat.agrupaments.hostmanager)

Comments

Aegir is built for doing domains

adrian's picture

It's not inconceivable that it might be able to subdirectory hosting in the future,
but there's a whole slew of things that need to happen for that.

Essentially, when you run Aegir, you have MULTIPLE DRUPAL RELEASES running concurrently.

Apache maps the domain names you are hosting to the DocumentRoot of one of these releases.

So when you go to myd6site.com, it knows that is hosted on /var/www/d6platform, and when
you go to myd7site.com, it knows that it is hosted on /var/www/d7platform.

When using Drupal's subdirectory hosting capabilities, all the sites on a single domain, would essentially
be using the same virtual host. ie: myd6site.com and myd6site.com/g1 and myd6site.com/g2 would be sharing
the same virtual host entry, mapped to the same document root.

So there would need to be some domain mapping trickery to alias/ remap subdirectories on domains to other domains,
because you could be in a situation where myd6site.com/g1 is running on /var/www/d7platform, and the others have
not been upgraded yet.

You can however accomplish what you want simply by creating a wildcard dns entry pointing to *.mydomain.com.

--
The future is so Bryght, I have to wear shades.

This would be a feature request

anarcat's picture

This is a actually a feature request that I would welcome. Right now, sites are provisionned based on their hostname, but there's no technical reason why we shouldn't also support subdirectories (other than the added complexity).

It should be possible for the apache provisionning system to add Apache config magic to make example.com/foo "do the right thing", probably with a simple Alias rule that would be added to an already existing vhost file.

Right now, the whole system assumes that a site == a virtual host, so that would require a lot of reflexion on how best to do this. For example, if you create a example.com/foo site and there is no example.com site, what happens when you visit example.com? What should be in the virtual host file? Which site "owns" the virtual host file? And more importantly, can client A create example.com/foo when client B already has a site in example.com (i hope not, but it's a valid question, and access controls would need to implemented here).

So it's a complex issue, but not an impossible one. I do not consider this a priority since a DNS wildcard does everything a subdir does, and better. Besides, subdirectories are potentially messy because they will take over aliases that could be used by the parent host. So in the example able, if i create a site called "example.com/user", guess what will happen with the user logins on example.com... ;)

Finally, in your original example, the feature you want can probably be accomplished within a single drupal site, with organic groups, for example.

It is simple to create sites

enboig's picture

It is simple to create sites using subdirectories; you just need symbolic links and create the apropiate directory and settings file inside "/sites/.../settings.php".

I my case I also need to have some tables shared, so I will probably create a module which read functions from a shared table and execute them on the installation. The idea is to have a "master" site where I insert instructions (drupal_execute(), etc...) and every "slave" site execute it and add a record for it in a non-shared table. But I have to thing a lot about this; updating modules when using shared tables is hard.

Anyone still interested?

zhangtaihao's picture

If anyone is still interested, I am currently developing a module to (hopefully) allow you to host a site under another.

http://zhangtaihao.github.com/hosting_subsite/

I'm close to releasing a prealpha-ish package. Anyone who wants to get an idea how it's supposed to work can take a look at the documentation/source code.

zhangtaihao, sub-directories on Aegir ? why ?

niccolox's picture

I'd be interested to know what the use-case is for doing sub-directory hosted sites on Aegir platform based sites ?

doesnt it add another layer of complexity in administration and basically defeat the purpose of Aegir altogether?

Aegir hosting system

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: