
Trying to sort out multisites in Drupal is a non-trivial task.
Drupal 6.0 has a really nice automated install and upgrade script for single-sites (a huge improvement from the dive-into-the-db approach of Drupal 4.6). Check out this videocast if you're pondering using Drupal and need to be convinced that a single-site install can be done by almost anyone now: http://drupal.org/videocasts/installing-6
The only thing I really get out of the brief instructions for multi-site from the install.txt file included in Drupal 6.0 is that for each domain (or subdomain) in the multisite installation I need to create an additional foder under the sites folder as such:
sites/default/settings.php
sites/example.com/settings.php
sites/sub.example.com/settings.php
sites/sub.example.com.site3/settings.php
What is frustrating is not finding a tutorial - you know do this, do that, you're done. Do I run install on this or do everything from the DB (phpmysql for me)? I also keep seeing notes about a virtual host or symlink to properly resolve domains and subdomains (but sometimes it seems like this is only needed for subdomains).
I found this snippet of advice regarding setting some tables as shared and some as site specific from http://drupal.org/node/201673
Open the file 'settings.php' in the sites/default folder. Go to line 93 (or somewhere around there) and you should find a line like this:
$db_url = 'mysql://username:password@localhost/databasename';
change this line with your DB name, DB user and password. It will look like:
$db_url = 'mysql://gar_tutorial2@localhost/gar_tutorial2';
Just below the line we just changed above, there is a line that goes like:
$db_prefix=’’;
Since we want to share some but not all of the tables in the database between our sites, we can instruct Drupal by adding site-specific prefixes for the names of those tables we do NOT wish to share.
Put the following into your settings.php file:
$db_prefix = array(
'default' =>'',
'blocks'=> 'main_',
'boxes' => 'main_',
'menu' => 'main_',
'variable' => 'main_',
'cache' => 'main_',
'cache_menu'=> 'main_',
);
This sets table sharing as the default, except for those tables listed, which are prefixed by 'main_'.
From the same URL this also looked useful (although I'm not completely sure i understand it yet) - advice on setting the cookie:
Our users and editors must be able to move freely between our three websites. To achieve this, edit the variable '$cookie_domain' near the end of the settings.php table, so that it looks like this:
$cookie_domain = 'example.local';
TAKE 1
Okay I tried this and got an error:
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/comixm/public_html/sites/comixmedia.com/settings.php on line 96
I think this is a simple php grammar error but since I can't see what the problem is....
So here's what's going on - default.settings.php is creating a settings.php for the comixmedia.com subfolder and it's not including the "array ( " part of line 96. Weird and definitely a bug.
WORKAROUND - And easy to get around apparently - I simply fixed the settings.php file created by the aborted install process - cleared the cache, reloaded the correct settings.php to the server via FTP and then restarted the install process from the beginning and this time it worked!
Okay If I create settings.php for each domain I can actually get the 2nd and 3rd domain to resolve; actually I did a series of beating at this - I tried a direct sql command to create the tables for the comixmedia.net but earlier was somehow able to trick the installation process into creating the tables for comixmedia.org. This is simply not easy and I can't find documentation that actually works 100% right now.
More importantly though I've got the tables and I've got the domains resolving but I can't log into .net or .org with the admin account I created with .com. Why? No idea right now. I would think with a single user table that you'd be able to log into each with the same account information.
Comments
dede
http://galeon.com/ciscos/index.htmlhttp://galeon.com/ciscos/index1.htmlhttp://galeon.com/ciscos/index10.htmlhttp://galeon.com/ciscos/index100.htmlhttp://galeon.com/ciscos/index101.htmlhttp://galeon.com/ciscos/index102.htmlhttp://galeon.com/ciscos/index103.htmlhttp://galeon.com/ciscos/index104.htmlhttp://galeon.com/ciscos/index105.htmlhttp://galeon.com/ciscos/index106.htmlhttp://galeon.com/ciscos/index107.htmlhttp://galeon.com/ciscos/index108.htmlhttp://galeon.com/ciscos/index109.htmlhttp://galeon.com/ciscos/index11.htmlhttp://galeon.com/ciscos/index110.htmlhttp://galeon.com/ciscos/index111.htmlhttp://galeon.com/ciscos/index112.htmlhttp://galeon.com/ciscos/index113.htmlhttp://galeon.com/ciscos/index114.htmlhttp://galeon.com/ciscos/index115.htmlhttp://galeon.com/ciscos/index116.htmlhttp://galeon.com/ciscos/index117.htmlhttp://galeon.com/ciscos/index118.htmlhttp://galeon.com/ciscos/index119.htmlhttp://galeon.com/ciscos/index12.htmlhttp://galeon.com/ciscos/index120.htmlhttp://galeon.com/ciscos/index121.htmlhttp://galeon.com/ciscos/index122.htmlhttp://galeon.com/ciscos/index123.htmlhttp://galeon.com/ciscos/index124.htmlhttp://galeon.com/ciscos/index125.htmlhttp://galeon.com/ciscos/index126.htmlhttp://galeon.com/ciscos/index127.htmlhttp://galeon.com/ciscos/index128.htmlhttp://galeon.com/ciscos/index129.htmlhttp://galeon.com/ciscos/index13.htmlhttp://galeon.com/ciscos/index130.htmlhttp://galeon.com/ciscos/index131.htmlhttp://galeon.com/ciscos/index132.htmlhttp://galeon.com/ciscos/index133.htmlhttp://galeon.com/ciscos/index134.htmlhttp://galeon.com/ciscos/index135.htmlhttp://galeon.com/ciscos/index136.htmlhttp://galeon.com/ciscos/index137.htmlhttp://galeon.com/ciscos/index138.htmlhttp://galeon.com/ciscos/index139.htmlhttp://galeon.com/ciscos/index14.htmlhttp://galeon.com/ciscos/index140.htmlhttp://galeon.com/ciscos/index141.htmlhttp://galeon.com/ciscos/index142.html