I have Drupal up and running and have followed config instructions to set up multiple sites to run on my local PC (Windows XP/PHP 5/MySQL 5/Apache 2.2/Drupal 5.1) for development of a couple of sites .

I have installed Drupal in //localhost/drupal and created a 'drupal' database and can access it.

I have created 2 other databases, DB1 which I loaded with data from a site I'd already created when running in single site mode. DB2 is a straight copy of the installed 'drupal' database

I created the sites/db1.org.uk and sites/db2.co.uk and amended the settings.php files to direct to the relevant databases.

I created vhost entries in httpd_vhosts.conf, after include this file as required in httpd.conf as per instructions. Entries as follows:

DocumentRoot "C:/www"
ServerName localhost.


DocumentRoot "C:/www/drupal"
ServerName db1.org.uk.


DocumentRoot "C:/www/drupal"
ServerName db2.co.uk.

Note that the 'VirtualHost' entries refer to the domain names and not *:80 as documented in some places. If *:80 used then the domain URLs "//db1.org.uk" and "//db2.org.uk" just direct to //localhost.

I can access db1 from //db1.org.uk - doesn't work properly for reasons yet to be worried about but the previously created home page content displays!
I can access drupal at //localhost/drupal - it displays the standard config page and I can log in with my admin user.
When I access //db2.org.uk it also displays the standard config page. I logged in and changed the site name from 'Drupal' to 'DB2' and logged out. When I accessed //localhost/drupal it, too, had a site name of 'DB2' - shock horror, but I was still logged in.

I can access drupal and am logged in and access db2 and I'm not. Odd but I'm a newbie, so hey-ho.

When I looked at the database db2.variable table shows that the site name is still 'Drupal' while the db2.variable table shows that the site name is still 'DB2'. In short both 'sites', Drupal and DB2, maintain the drupal database tables. So I don't have a multisite config that's working.

I'd be grateful for expert guidance.

Mark

Comments

josesanmartin’s picture

In your Apache config you have:

DocumentRoot "C:/www/drupal"
ServerName db2.co.uk

but you are accessing: http://db2.org.uk

Have you noticed that the first one is "co" and the second one is "org"?

Was that your problem?

(By the way what you mean "standard config page"? Isn't it the installer, is it? What's the URL?)

Regards

José San Martin

José San Martin
http://www.chuva-inc.com/

mc.edwards’s picture

Thanks for responding.

"http://db2.org.uk" is a typo in the post - the URL I'm using is, in fact "http://db2.co.uk" as in the config file.

The standard config file is the Drupal 'Welcome to your new Drupal website!' page - first page after installation - not the installer as I had already installed it into each of the database schemas mentioned. URL is "http://db2.co.uk"

Still struggling!

Mark

josesanmartin’s picture

Not? Uhb.

To understand what's going on do it:

1) open the settings.php of each folder (db1.org.uk, db2.co.uk and default) and check the $db_url lines. Are they correctly appointing to three different databases or not? If in doubt, send here the lines (strip the password, of course).

2) download three different themes and install each one of them in one of the three folders. Does it work as expected? Each installation should be able to see just one theme.

José San Martin

José San Martin
http://www.chuva-inc.com/

mc.edwards’s picture

These are the settings.php entries for the databases (note that I originally installed the DB1 database in a single site installation and gave it a prefix):

DB1:

$db_url = 'mysql://db1user:db1usrpw@localhost/db1';
$db_prefix = 'db1';

DB2

$db_url = 'mysql://db2user:db2usrpw@localhost/db2';
$db_prefix = '';

The standard drupal default settings are as follows:

$db_url = 'mysql://drupal:pw@localhost/drupal';
$db_prefix = '';

It all looks OK to me.

The DB1 and DB2 sites' themes folder each have a different theme in them. When I look at //localhost/DB1 I see the front page content only - no menus or theme or anything - just text. When I look at //localhost/DB2 I see the default theme for a plain drupal install, same as when I access //localhost/drupal.

Beats me what's going on!
Thanks and regards
Mark

josesanmartin’s picture

You won't see any theme over there, in the frontpage, the default theme is still enable. Open /admin/build/themes and check if they are there.

José San Martin
http://www.chuva-inc.com/

mc.edwards’s picture

Sorry, should have said:

the default drupal themes folder contains the following:
bluemarine
garland
pushbutton
chameleon

The db1 themes folder contains the following:
garland

I cannot check in admin/build/themes for //localhost/db1.org.uk as there are no menu items available!

The db2 themes folder contains the following:
aberdeen

For both //localhost/drupal and localhost/db2.co.uk, in admin/build/themes I can see the same list of themes as follows:
bluemarine
garland
pushbutton
chameleon
marvin
minelli

Thanks and regards
Mark

josesanmartin’s picture

for DB1: Install a theme for testing other than garland (a non-default theme, please) at DB1 and try to access //db1.org.uk/admin/build/themes

for DB2: aberdeen should be listed at db2. If it's not, it means that Drupal is not accessing the correct folder inside "sites". I really don't think it is a bug in Drupal. Two suggestions.

1) Please double, triple check it:

You are typing exactly the URL http://db2.co.uk/ in your browser? And anything else, no subdomain, no folder, no port:80, anything at all? It would NOT be http://localhost/db2.co.uk, would it?

If it's exactly http://db2.co.uk/ what you're typing in the browser, triple check you have a folder named (your Drupal installation)/sites/db2.co.uk and it's not misplaced or misspelled.

2) Perhaps it's just a permission trouble. (quite uncommon when using Windows, it normally allows you to access everything) Check if the both folders of yours and especially the settings.php files are readable by the server. Check also if settings.php of both folders are read-only. (if it is not read-only, the site should still work, but check it anyway)

Regards,

José San Martin

José San Martin

José San Martin
http://www.chuva-inc.com/

mc.edwards’s picture

Thanks.

Stupidly I had site/db2.org.uk instead of .co.uk. That one seems to be OK - can see the aberdeen theme

db1.org.uk is more of a puzzle. I have loaded the amadou theme into site/db1.org.uk/themes and typed //db1.org.uk/admin/build/themes. Alas it serves the customised page denying me access as I'm not logged in and, having no menu options, I don't know how to.

So it serves up the correct content but nothing else.

I can only assume this is something to do with the fact that I developed this site in a default configuration in which it was fine and then moved it to a multisite config. Has the php config got anything to do with it? Not something I know anything about.

Thanks and regards
Mark

josesanmartin’s picture

co, org, co, O.o confusing! But nice to hear it works now!

What happens if you type:
http://db1.org.uk/user

Can you login there? Or if you don't have the password, can you recover it and login again?

Regards,

José San Martin

José San Martin
http://www.chuva-inc.com/

mc.edwards’s picture

Typed the ../user url and could login as administrator. I then looked at ../admin/build/themes and amadou was visible. I also but a bunch of site specfic modules into the sites/db1.org.uk/modules folder and they're all there and enabled.

Alas though I still cannot see any menus - only the site content is visible to me - no side bars, header or footer regions.
If I enter http://db1.org.uk/node/n where n is the node number I seem to get the content I expect (although some just give me the 'welcome to drupal' page for some reason?!

Weird

Thanks for your patience
Mark

josesanmartin’s picture

If you type /node/n and you get "Welcome to Drupal", it means that:
1) there no node with id = n
2) there is no node promoted to frontpage (check "publishing options", in node form editing)

Check if you have the block navigation enabled by going to "/admin/build/blocks" and if some menu items are enabled, in "/admin/build/menus"

José San Martin

José San Martin
http://www.chuva-inc.com/

mc.edwards’s picture

Thanks for the node tip - I'd figured that one out - point 1 was the issue

I've looked at the db1.org.uk/admin. It displays the page with links to for example build/modules, themes and blocks but not menus. The menu folder is in the drupal/modules - I also out it in the site/../modules folder to no avail. Menus module is enabled.

When I looked at blocks page then, interestingly, there were no regions available to put blocks in!

Having said all that, I've just realised I didn't have a default theme set. When I copied in one I'd been developing (which was originally set as the default) the menus and regions miraculously appeared. It now works!

I couldn't see the menu option because, somehow, my admin user was not allowed to administer menus - beats me how that happened but who cares!

Many thanks for your help - without it I'd have given up in despair long ago

Mark

josesanmartin’s picture

Good to know everything is fine.

If you happen to publish something, send it to this forum: http://drupal.org/forum/25

Regards,

José San Martin

José San Martin
http://www.chuva-inc.com/