I'm trying to run multiple sites on my local server over the same core, and I've read the multi-site docs pretty thoroughly, so I'd like to think that I know what I'm doing.

My sites folder looks like:

all
default
localhost.bsc
localhost.cci

And the Drupal directory that contains this sites folder is the DocumentRoot to simplify things.

Shouldn't visiting "http://localhost/bsc" load the site at localhost.bsc? Or at least fail in exciting ways? Because it's clearly including the settings.php file from "default," as seen by the redirect to install.php. Does this sort of thing not work with localhost?

Comments

tmallen’s picture

Note: After going through the install process (just to be sure), visiting "http://localhost/bsc" returns a "Page not found" for the default install...

cog.rusty’s picture

When you visit http://localhost/bsc the web server tries to go to /bsc and to find an index file there, and of course it fails. Or Drupal's .htaccess produces a similar "not found" effect.

So, although your setup is good enough for Drupal to identify and to bring up the site you requested, Drupal doesn't receive a request for a site.

There are two ways to fix this:

- Make your sites subdomains instead of subdirectories (sub.localhost) and create additional virtual hosts for them in httpd.conf, all with the same DocumentRoot.

- Or create symlinks (or "junctions" if you are on Windows) under your document root, named bsc etc, which will appear like subdirectories but will lead back to Drupal's directory.

tmallen’s picture

Right, but I'm pretty lost on a Windows box anyway, and I'm not sure how to make symlinks there. I tried using shortcuts, but Apache doesn't pick those up like it would a true ln -s.

I edited my /etc/hosts file and added a bunch of subdomains for localhost. I do think that somebody should edit the current docs on Drupal, because the wording right now makes localhost/sitename <-> localhost.sitename/ seem like a possibility, when that's not quite the case.

cog.rusty’s picture

Windows shortcuts won't do for symlinks, because when you follow a folder shortcut you end up in a folder with the original name. With symlinks you end up in a directory with the symlink's name.

So, for Windows you need a program called junction.
http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

Note that junction's command line syntax is the reverse of symlinks. That is:

junction path-with-new-name target-path
chasz’s picture

you havent mentioned anything about settings.php ?

prodosh’s picture

If you create a subdomain in your hosts file like
127.0.0.1 bsc.localhost
then http://bsc.localhost will work

For all the gory details about multisite installations see: http://drupal.org/node/167639

_______
Anolim: developing and supporting multimedia, community and collaboration solutions

_______
Safe Swiss Cloud: Enterprise grade cloud infrastructure for Drupal B2B solutions and platforms.