I am sure multisite installs work the same in D6 as in D5.

I get the error:

The Drupal installer requires write permissions to ./sites/default during the installation process. If you are unsure how to grant file permissions, please consult the on-line handbook.

The problem is that I don't want the installer to use ./sites/default but ./sites/mysubsite which exists, is writeable, and includes the file default.settings.php, but the Drupal installer doesn't seem to read it.

I do access the install.php via /mysubsite.
I do this all the time with D5, but it doesn't seem to work with D6 on the same development platform.

Comments

beginner’s picture

Priority: Critical » Normal

Oh!
I see. I had to do:
cp default.settings.php settings.php

I thought the installer would look for default.settings.php in my added folder, just like it does for the default folder.
This is a different behavior than in D5, and I just looked at INSTALL.txt, it is not documented there.

beginner’s picture

Priority: Normal » Critical

Actually, there IS a problem.
After I did cp default.settings.php settings.php, the installer believes the settings are ok and tries to connect to the DB:

Failed to connect to your MySQL database server. MySQL reports the following message: Access denied for user: 'username@localhost' (Using password: YES).

At this stage, I am not sure I understand how to do a multi site install with the D6 installer.

I think the installer should be able to read default.settings.php off the relevant directory in sites/.

catch’s picture

cburschka’s picture

I have the same problem. I've been using Drupal since 4.7 and have read most of its code at least once, but the installer and its handling of multisites feels like voodoo to me.

Making an empty settings file in a desired sites directory occasionally works, and sometimes does not. It's pretty obvious that the installer is a recent feature introduced only with the currently released version, and doing anything advanced will still require you to enter a shell and mess around in the settings files.

See also:

- http://drupal.org/node/106727
- http://drupal.org/node/155309

vjordan’s picture

Priority: Critical » Normal

The installation workflow seems to have changed a little between d5 and d6. Previously you could copy a default settings.php file into your sites/sub.example.com/ folder and when you went to sub.example.com drupal would detect a default db_url and proceed to the install process. Now this way of doing things doesn't work. One of the issues to have triggered a change to the way the installer works: http://drupal.org/node/99011

What works is editing the settings.php for each site in the appropriate directory under sites/
Then invoke the installer directly using sub.example.com/install.php

To be fair, if you follow the instructions in INSTALL.txt setting up multisites works (it's just different, and possibly a little less convenient than d5):

Additional site configurations are created in subdirectories within the 'sites'
directory. Each subdirectory must have a 'settings.php' file which specifies the
configuration settings. The easiest way to create additional sites is to copy
the 'default' directory and modify the 'settings.php' file as appropriate. The
new directory name is constructed from the site's URL. The configuration for
www.example.com could be in 'sites/example.com/settings.php' (note that 'www.'
should be omitted if users can access your site at http://example.com/).

I'm not sure this is a bug. It's just a different way. Multisites are hard enough (I agree with the voodoo comment) and this change in behaviour might be a hard transition for people to make. But I'm not sure this is a critical code bug.

Changing to 'normal'.

catch’s picture

scoutbaker’s picture

I agree with vjordan. Being new to Drupal I don't have the history of setting up multisites under previous releases, so I don't have any expectations regarding how-things-work for this feature.

If it's truly just different, that certainly isn't a bug. And especially isn't critical. I'll see about setting aside some time this evening to try a multisite install following the directions. It appears that such an exercise would be useful for a couple of current issues.

john.r’s picture

The problem is that I don't want the installer to use ./sites/default but ./sites/mysubsite which exists, is writeable, and includes the file default.settings.php, but the Drupal installer doesn't seem to read it.

I do multisite a bit in D5, too. For D6, all I had to do different was change the name from "default.settings.php" to "settings.php" inside my subdomain's folder:

drupal/sites/subdomain.domain.com/default.settings.php

change to

drupal/sites/subdomain.domain.com/settings.php

Good luck!

gábor hojtsy’s picture

Category: bug » support
Status: Active » Closed (fixed)

Looks like a documented behavior change.

vjordan’s picture

Title: multisite install (with sub directory) does not work. » multisite installation process changes from d5 to d6
Category: support » bug
Status: Closed (fixed) » Active

I've looked at the multi-site documentation on drupal.org. On many pages the guides refer to using the default settings.php (without edits) for an "easy multi-site install" option or something like it.

http://drupal.org/getting-started/5/install/multi-site has:

# Create your new site directory in /sites folder
# Place a new, blank settings.php file in the directory.

http://drupal.org/node/167639 has (in three places):

copy the default settings.php file that came with the Drupal distribution into the above directory.

It is IMPORTANT that the you use this original settings.php file, OR ELSE the easy Drupal install procedure DOES NOT WORK. Make sure you have created a separate database for this site in MySQL before starting the install.

The page 10 Minute Multisite Install & Configuration has :

I've read that it's not necessary to make changes to setting.php.

What's possibly worse is that some of the forum postings which beginners evidently find helpful, such as this, also recommend using the default settings.php and let the installer configure the DB settings. And the support requests for multi-site on d6 have already started.

So on reflection there's a number of approaches possible here:

  1. review and update all the multi-site documentation for the new requirement that settings.php MUST be updated (unlike d5)
  2. update the code so the old way of using a default settings.php will continue to trigger the install process
  3. or perhaps even more useful might be to replace the multi-site information in INSTALL.txt by styro's advice for multisite newbies (his emphasis)?

    Don't use multisite. You might think you need it, but you most probably don't. If you don't know webservers and how they work enough to instinctively understand what happens with multisite setups, and don't have a better reason to use it than "I want to save less than a MB of server space" or "I only want to upload my Drupal once", then I would recommend staying away from it.
    In most cases it adds unnecessary complexity, reduces flexibility between sites and makes future upgrades harder.

    How many people wish they'd read that before they went off the multisite cliff?

It'd be great if any of the folks who handle the multi-site support requests so well could offer a view on a good way forward here. They might be the people we all rely on to pick up these pieces.

cburschka’s picture

I would disagree there. multisite is a powerful tool, and that it is unnecessarily complex is not the fault of multisite, but that of the installer that does its best to make it hard on those who use it. See also this: http://drupal.org/node/155309

gopherspidey’s picture

Multisite has changed between D5 and D6. You only have to create a directory for the new site (aka sites.www.example.com), but the is a bug in the Drupal 6 installer. It prevents the installer from properly finding you sites directory. See below

http://drupal.org/node/209240

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)

http://drupal.org/node/209240 was commited. is there still a TODO here?

scoutbaker’s picture

subscribe

cburschka’s picture

The bug is fixed with #209240: multi-site files bug, I guess. I am trying to add a feature for D7 (#155309: Better multi-site support in the installer), but that is way outside the scope of this issue.

scoutbaker’s picture

@Moshe: It seems like there might be room for some new or updated documentation on the process for D6.

TheGMan’s picture

I guess my issue is on how to create to Tables for additional sites.

If you try and run the Install.php files for other sites it tries and get the /Default/ site settings.php

I guess once the tables are created for other sites you can just re-write the Settings.php as instructed
for Multisite setup but I can't even create tables for other sites... and I've read Hundreds of posts regarding
this and NO ONE mentions how to "automaticaly" create tables for other sites in a multisite setup. They always
skip that step in the installation process. Unless the only way is to create them manually?

I also always have to rename my Default directory under SITES if I want to get to my other sites...if not
all my domains always trigger the /Default/ setting file.

Has anyone found a solution yet?

all these problems are with DRUPAL 6 of course

gflare’s picture

G-man,

I had the same issue, and no one seems to address it so I found the solution myself.

- Run the installer for site1, then rename site1/settings.php to a backup.
- goto site2, and run the installer for site2. Then rename that to a backup.
- repeat for any additional sites that you have.

- When you have created all of the sites, you can then rename all the backups to settings.php .

Now you can access the sites individually, site1.com, or site1.domain.com whichever method you are using.

If you wish to share tables (for user data, etc.), you can just edit the settings.php file for site1 and site2, using the array that is included in the drupal documentation to point them all towards one table (site1_users or whatever for all the shared tables).

* To have all database names prefixed, set $db_prefix as a string:
*
* $db_prefix = 'main_';
*
* To provide prefixes for specific tables, set $db_prefix as an array.
* The array's keys are the table names and the values are the prefixes.
* The 'default' element holds the prefix for any tables not specified
* elsewhere in the array. Example:
*
* $db_prefix = array(
* 'default' => 'main_',
* 'users' => 'shared_',
* 'sessions' => 'shared_',
* 'role' => 'shared_',
* 'authmap' => 'shared_',
* 'sequences' => 'shared_',
* );

I hope this helps some people, since it took me some trial and error to figure out.

*updated to include the array to share user info tables*

beezel-dupe’s picture

did you actually try installing with shared tables? it doesn't work. somebody else reported the same thing i'm seeing when i try your method with shared tables: http://drupal.org/node/209862

dpearcefl’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Closing due to lack of response.