Trying to do multisite in 5 but I am lost.
I have done a clean install of 5 and it automatically builds the tables for the default site. I then create another site eg. sites/example.com/ and move the settings file, then create DB. When I browse to it, unlike the first site which will build the db structure, this just errors (blank page).

I am sure there is a standard method, just the doco does not show how.

Please help me!

Comments

HedgeMage’s picture

It sounds like you copied the settings.php file from sites/default (which was already configured for your first site) to sites/yournewsite.com/ This confuses Drupal, because the directory for your new site's information then contains the database settings for your old site. There are two ways to fix this (do whichever is easier for you, the results are identical):

Method One: Delete the settings.php from sites/yournewsite.com/ and replace it with a copy of sites/default/settings.php from the official tarball. (This generic version was changed on your install when you set up your first site.) After this, you can go to your new site's URL and go through the installation process just like you did for your first site.

Method Two: Open sites/yournewsite.com/settings.php in your favorite text editor and edit line 93 to reflect your new site's database information. It should look like: $db_url = 'mysql://username:password@localhost/databasename'; "username", "password", and "databasename" should be replaced with the obvious, "localhost" is your mysql hostname (if your web server and mysql server are the same, this will be "localhost", if not it will probably need to look something like "mysql.example.com"). Then you can go to http://www.yournewsite.com/install.php which will start the install process at the step immediately after entering your database information (which you just did manually).

While we're at it, here's a side note on how to avoid the most common mistake I see people running multisite installs for the first time make: Make sure that sites/default/ and sites/yournewsite.com/ each contain their own files directory. Then for each site, go to http://www.example.net/admin/settings/file-system and make sure that the "File system path" field indicates those directories (sites/default/files or sites/yournewsite.com/files) rather than just files. If you already have files in /files from your first site, you will have to move them to sites/default/files. This way, files for each site are separate. If you move or delete a site, you know which files belong to it and can move or delete those, too, without any special effort on your part. Also, it keeps the namespaces for the two sites' uploaded files seperate.

verit’s picture

Thank you for responding to my post and yes it worked perfectly.