Drupal and Sub sites
I am working on migrating our entire College site into Drupal.
We have 50+ sub sites (sub directories, not subdomains) that will need their own "site".
We will be using LDAP to authenticate users.
Each user will have the ability to edit content, upload files, add images and video, add edit and delete pages etc.
I would like to have one point of update for Drupal core files and installed modules for all sites.
I would think that having separate db's for each site makes sense, but I could also argue the other way as well.
I had multi site manager module installed, however am not convinced that is the best way to approach this.
Is Drupals multi site installation the best way to go?
What are other College/Universities doing and what problems have you ran into?
Thanks for your help/suggestions!

I currently have 100+ sites
I currently have 100+ sites at my university and we use multisite. If I was to recommend a way to go it wouild be use Aegir. http://groups.drupal.org/hostmaster2
0.4 version is going to be the one you will want to use. It will make upgrading those 50 sites a whole lot easier. Also it'll make it easier when you want to move to Drupal 7 so you can move each site one or more at a time instead of all at once. It's takes some work to set up, but it is definitely worth it in the end.
I'll take a look at that.
I'll take a look at that. Are you using the multisite installation or multisite manager module? Either one you're using, have you run into problems with it?
We use a straight multisite
We use a straight multisite installation. We add a core patch that fixes some things for us http://drupal.org/node/231298 I have my own set of scripts also that help me create sites and update the sites.
Thanks for the info. Do you
Thanks for the info. Do you have sep db's for each site? Sorry for so many questions. New to setting up this large of a project in drupal and want to make sure I cover it all to make the transition as smooth as possible.
We use separate DB's there's
We use separate DB's there's no reason to really make it one db unless you really are required to. That just creates extra complications.
Domain Access
Our university is rolling out Drupal to around 150 domains this next two months, and we currently are running a handful in production and all the rest in a *.staging subdomain for migration from our old CMS and testing.
We haven't hit any problems yet, but Domain Access can be a little bit of a bear to get your head wrapped around, and getting it to play nicely with our Varnish server and Pressflow took a little tinkering. However, the benefits of going this way are:
We spin out other multisites for our sites that have special needs or differ radically from the others (I've only had two so far that actually needed custom stuff.) You can also do a lot of what Domain Access does using Organic Groups and the Subdomain module, but there are issues with that as well (we need to use Domain Access' "table prefixing" feature to ensure that each domain gets it's own url_alias table so multiple sites can have the same "/about" page, for example.)
Once we finally get our new design finished and everyone rolled out (all at the same time!) in October, I'll document what we did and leave a note here with a link to the whitepaper on it.
--
Web Programming Specialist, Cal State Monterey Bay
Went a similar way at California Institute of the Arts
At CalArts, we had a use case where we needed to be able to publish content over to different domains when the need came (and we needed a way to ensure that certain content types were always sourced on the main site with the other sites getting published options. We were also trying to figure out between going with a Feeds/Services route to push certain content types around to the other sites and using the domain access module.
In the end, we opted to go with the Domain Access module - we were able to get a fair amount of control out of it, our sites would have a similar look and feel (though we created some modules which were flexible enough to handle having different 'flavours' of the site out and about) and most importantly, we were able to ensure that certain content would always be available on our primary domain and then could be published to the other subdomains and the data would be consistent all across.
With that said, we have also run into usecases where the domain access module we are using for our main site (and for about 20 other sites at this point which have opted in on the project) will not fit - we will have to start considering a multisite setup and how it will tie in with the work done for the primary site(s) - most likely, we'll use feeds to share some of the data. Moreover, there are certain things that are a giant pain in the butt to harangue on the site (publishing feed items to the right domains required a little bit of 'magic' code which I would have preferred not doing but it now works correctly. Theme settings and certain other settings are also a pain to deal with when working with a domain access setup. And like Kevee, we have to use table prefixing on a number of tables so we can ensure caching and url aliases (and block settings - wanted to give the various domains ability to set up their own blocks without doing some craziness to the other sites) - a number of tables on the site!).
But so far, everyone that has seen the site and how the publishing works is very happy with it. As I mentioned, we are guaranteed on where certain content gets published, the site does serves little to no duplicate content for the particular content types (such as our news, events, and faculty), and there is h. And hopefully this will be a little (?) easier to manage than multiple sites w/ multiple databases and the sharing of content in between (much like Kevee, we get a lot more control of the site). I am very curious to hear about the experiences of getting pressflow + domain access and what kind of things you ran into, Kevee. Also, we are expecting to launch our site(s) by the end of the month and once that is done, I will also document the kinds of things we did (why we did it, how we could improve it, future plans) :)
Penn State University
See my comment at http://groups.drupal.org/node/3282#comment-274449 for more info.
APSU - LDAP and Taxonomy Access Control Lite
Austin Peay State University (www.apsu.edu) is using a single large site that is subdivided for different departments via taxonomy and Tac Lite (http://drupal.org/project/tac_lite). We use the LDAP Integration module to integrate with our Active Directory system for authentication. We've been pretty happy with this so far, but it may not work for every school.
Mark W. Jarrell
Web Services Specialist
Austin Peay State University
http://fleetthought.com
http://www.apsu.edu
Twitter: attheshow
Thanks
Thanks for all the info.
My problem now lies with naming the subdirectories with the multi site installation. I'm working on a development server as we're migrating all of our content over in the next year.
So our URL example.com is already being used and active on another server. What do I name my subdirectories then if i cant put it at "sites>example.com.subdir"?
Could I just use the IP address of the development server instead of example.com? If I do that, is it possible to change it later?
That's why I use this patch
That's why I use this patch http://drupal.org/node/231298 It allows me to name my subdirectory "example" and then I have a php file that says
<?php$sites = array(
'example.com' => 'example',
'dev.example.com' => 'example',
);
That way no matter if I go to example.com or dev.example.com it points to the same subsite. This feature is already in D7. They felt it was too much like a new feature to backport it to D6
I guess i'm not fully
I guess i'm not fully understanding this, I'm sorry for my ignorance.
realsite.com is the actual URL we will be using once the migration from the current CMS to Drupal is complete.
Currently we have:
realsite.com with 50+ sites off of this at
realsite.com/site1
realsite.com/site2
etc.
In my dev environment, we just have an IP address. I'd like to set up our multi sites in a similar way to the current set up:
ipaddress/mainsite
ipaddress/newsite1
ipaddress/newsite2
When ready to go to production, ipaddress will need to change to realsite.com
How is my sites directory supposed to be set up with what you are suggesting?
sites/mainsite
sites/newsite1
sites/newsite 2
If so, do I have to add a line to the php file for every site i create
so it would ready ipaddress/newsite1 => newsite1 ?
If doing that, when ready to transfer to production, i need to just add the realsite.com to the mix?
So using your example I would
So using your example I would do
$sites = array('ipaddress/mainsite' => 'mainsite',
'realsite.com' => 'mainsite',
'ipaddress/site1' => 'site1',
'realsite.com/site1' => 'site1',
etc.....
);
It will work for your ipaddress until you are ready to point realsite.com to your server. Once you do that the IP address and realsite.com will work. You can remove all the ones that use ip address when you feel comfortable and it will continue to work via realsite.com
Your sites directory would be
sites/main
sites/site1
sites/site2
etc.
That makes sense and sounds
That makes sense and sounds like it's exactly what I'm looking for. How do you install the patch for Drupal 6?
If you don't know how patch
If you don't know how patch files work. Here is the one you want to use. http://drupal.org/node/231298#comment-2847662
+'s are things to add to the file
-'s are things to remove from the file.
You can safely ignore adding all the comments if you want. This is the part of the patch you care about. It is saying around line 247 in includes/bootstrap.inc you apply these values.
@@ -247,12 +271,22 @@ function conf_path($require_settings = T
}
$confdir = 'sites';
+
+ $sites = array();
+ if (file_exists($confdir . '/sites.php')) {
+ // This will overwrite $sites with the desired mappings.
+ include($confdir . '/sites.php');
+ }
+
$uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']);
$server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
for ($i = count($uri) - 1; $i > 0; $i--) {
for ($j = count($server); $j > 0; $j--) {
$dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));
- if (file_exists("$confdir/$dir/settings.php") || (!$require_settings && file_exists("$confdir/$dir"))) {
+ if (isset($sites[$dir]) && file_exists($confdir . '/' . $sites[$dir])) {
+ $dir = $sites[$dir];
+ }
+ if (file_exists($confdir . '/' . $dir . '/settings.php') || (!$require_settings && file_exists($confdir . '/' . $dir))) {
$conf = "$confdir/$dir";
return $conf;
}
So after
$confdir = 'sites';add
$sites = array();if (file_exists($confdir . '/sites.php')) {
// This will overwrite $sites with the desired mappings.
include($confdir . '/sites.php');
}
And although the patch looks more confusing than this it wants you to replace this
if (file_exists("$confdir/$dir/settings.php") || (!$require_settings && file_exists("$confdir/$dir"))) {With This
if (isset($sites[$dir]) && file_exists($confdir . '/' . $sites[$dir])) {$dir = $sites[$dir];
}
if (file_exists($confdir . '/' . $dir . '/settings.php') || (!$require_settings && file_exists($confdir . '/' . $dir))) {
Hope this helps
Thank you so much for your
Thank you so much for your help. So do I then put my sites array with the domain name and the directory name in a sites.php file? Where does that file go?
You put the sites.php file in
You put the sites.php file in the "drupal_install/sites" directory.
Thanks soo much. Do you
Thanks soo much. Do you still use sym links with this set up?
Yep So here are my
Yep So here are my symlinks
www/drupal -> www/drupal-6.19
www/drupal-6 .19/sites -> www/drupal_sites
Let's say 6.20 comes out I'll create a new folder drupal-6.20. I'll delete the sites directory in there and symlink drupal_sites as the sites directory. Then when I'm ready to upgrade I remove the drupal symlink and then symlink drupal to drupal-6.20
So I've followed the multi
So I've followed the multi site installation http://drupal.org/getting-started/6/install/multi-site, added the above patch but my subsites (sub directories) are not running the install script. They're using the same db that my main install is using. Any ideas why it won't run the install script? I'm at a loss.
Drupal core files lives off the public_html on my server.
Make sure you are not copying
Make sure you are not copying the settings.php file from the default folder. You should make a copy of default.settings.php and rename it to settings.php in every new site you create.
I've done that and it still
I've done that and it still seems to be ignoring the install.php file. I'll see if I can start fresh again. I have no other ideas what it could be.
Is there any special that needs to be added to the apache config file for this?
And, I don't have it included but want to make sure, in bootstrap.inc, I don't include the array there, correct? Only in the sites.php file?
As an update, I added my development IP address in front of the subdirectory name and it worked as it was supposed to.
so my sites directory looks like:
sites/ipaddress.subdir
Isn't that what the patch was supposed to fix? What am I doing wrong? I followed the steps you gave me for the patch exactly. hmmm.
That should work as long as
That should work as long as you are going to ip.address/subdir in the url. What does your sites.php file look like? does apache have permissions to read that file?
My sites directory is set up
My sites directory is set up like this
sites/all
sites/default/settings.php
sites/ipaddress.subdir1/
sites/ipaddress.subdir1/settings.php
sites/ipaddress.subdir2/
sites/ipaddress.subdir2/settings.php
sites/sites.php
The permissions on the sites.php file are set so that apache can read it. Is there more configuration that needs to be done? Maybe in the apache config or htaccess?
The problem I'm running into with this set up is that we have a subdomain that is pointing to the root of the html directory, but the subdomain doesn't understand what is going on.
If I go to the URL http://ipaddress/subdir1 I'm prompted to follow the installation process for Drupal which is good! If I go to sub.domain.com/subdir1 I'm taken to the Drupal root index page. That may be an issue that our IT department needs to resolve though.
When I tried naming my subdirectories with the subdomain (sub.domain.com.subdir1), it failed.
What I would ideally like to work is to have my sites directory as you described previously.
sites/all
sites/default/settings.php
sites/subdir1/
sites/subdir1/settings.php
sites/subdir2/
sites/subdir2/settings.php
sites/sites.php
With the sites.php file holding the URL paths. I'm not sure why it is not working that way. Perhaps something has changed in bootstrap.inc in the most recent update to Drupal 6.19 which makes the patch not work?
Can you show me your
Can you show me your sites.php file? It should look like this
$sites = array('ipaddress/subdir1' => 'subdir1',
'sub.domain.com/subdir1' => 'subdir1',
);
By taken to the drupal root you mean you are taken to the site that is created underneath default correct?