I'm trying to set up two very different and unrelated sites here using one instance of Drupal. I followed the directions in http://drupal.org/node/516608 (Multisite setup using a single Drupal instance) but it looks like both sites are sharing the same database rather than using their own. Here are the facts (names have been changed to protect the innocent...):

*Drupal is installed at /var/www/html/wahoo
*The "original" site is www.wahoo.info
*The "second" site is www.selling.com
*wahoo.info seems to work fine as I was able to add content to it, etc.

My Apache virtual hosts are thus (Note that I've changed to "[]" brackets to get stuff to display here.)

##Name Based Virtual Host for wahoo
[VirtualHost 206.XX.SSS.TTT:80]
ServerAdmin webmaster@wahoo.info
DocumentRoot /var/www/html/wahoo
ServerName www.wahoo.info
ServerAlias wahoo.info www.wahoo.info
DirectoryIndex index.php index.html
#UserDir disabled
ErrorLog /var/www/html/wahoo/logs/error_log
TransferLog /var/www/html/wahoo/logs/access_log
[Directory /]
AllowOverride All
[/Directory]
Options All
#CustomLog logs/dummy-host.example.com-access_log common
[/VirtualHost]

#Name Based Virtual Host for selling.com
[VirtualHost 206.XX.SSS.TTT:80]
ServerAdmin webmaster@selling.com
DocumentRoot /var/www/html/wahoo/
ServerName www.selling.com
ServerAlias selling.com www.selling.com
DirectoryIndex index.php index.html
#UserDir disabled
ErrorLog /var/www/html/wahoo/selling/error_log
TransferLog /var/www/html/wahoo/selling/access_log
[Directory /]
AllowOverride All
[/Directory]
Options All
#CustomLog logs/dummy-host.example.com-access_log common
[/VirtualHost]

As you can see, both virthosts point to the same root directory. That's what it said to do in the instructions.

I've made the /var/www/html/wahoo/sites/selling.com directory and copied settings.php from /var/www/html/wahoo/sites/default into it. I then edited the file to change the database username and password to the database that I created for selling.com. Only problem is, when I go to www.selling.com, I see the page for wahoo.info.

Can anyone tell me where I went wrong here? The directions seemed very clear and easy to follow, so I'm not sure what the problem is?

Thanks in advance!

veg

Comments

zbricoleur’s picture

Is $base_url set in the selling.com settings.php file?

veg-o-matic’s picture

It wasn't, so I changed it. But that didn't make any difference. Do I have to set it for both wahoo.info and selling.com?

veg

zbricoleur’s picture

No, you probably don't have to set it for either. I was just checking that you didn't have it set for wahoo.info in the copied-over settings.php file for selling.com. I've done that before and the result is similar to what you describe.

So, you have the two settings.php files set up like this, right?

$db_url = 'mysql://selluser:sellpassword@localhost/selldatabasename';
$db_prefix = 'sell_'; 

$db_url = 'mysql://wahoouser:wahoopassword@localhost/wahoodatabasename';
$db_prefix = 'wahoo_'; 

If so, then I think your virtual hosts are not set up correctly. Unfortunately, my experience is mainly on WIMP so I can't offer any guidance there. (Although you might try changing these lines--[VirtualHost 206.XX.SSS.TTT:80] to <VirtualHost *>

veg-o-matic’s picture

I have the database names specified in $db_url, but I didn't have anything in $db_prefix. I changed them to $db_prefix = 'selldatabasename_'; and $db_prefix = 'wahoodatabasename_';, but when I did that and tried to go back to the sites, all I got was a Page Not Found. I didn't get anything back until I changed both lines to $db_prefix = ' '; (what it was originally.)

I also tried changing VirtualHost 206.XX.SSS.TTT:80 to VirtualHost *:80 but when I did that, no matter what URL I used, I only got to the home page of the first virtual host I had set up in httpd.conf.

This is very frustrating! The instructions I followed (see original post) made it sound so easy...

veg

Cybergarou’s picture

You only have to change $db_prefix if you are using one database for two sites.

The only difference I can see between the instructions and what you say you did involve the first page you go to. You said you went to www.selling.com, but the instructions indicate you should go to www.selling.com/update.php first. Since I haven't tried this kind of setup before I don't know if that's important, but it could be a required step before the site shows up correctly.

veg-o-matic’s picture

The instructions said to go to www.selling.com first, and you should land and www.wahoo.info:

Make sure that www.mysecondsite.com is parked on your server. By default (at least in CPanel) it will point to your root html directory which is exactly what we want.

Assuming the parked domain has propagated typing in www.mysecondsite.com at this point should show you your drupal implimentation at www.myDupalSite.com

That worked fine.

Odd, but if I change the folder name for selling.com to anything else, I get a blank page??

veg

Cybergarou’s picture

Sorry, I didn't consider that an actual step in the process. The step I was referring to was the following.

Now you can go to http://www.mysecondsite.com/update.php and run through the implimentation to populate your new Drupal site database.

Basically, the new database is blank so there is nothing for Drupal to show at the new site. It reverts to showing the first site until you finish the setup. By running update.php using the new site address, you create all of the tables needed by Drupal.

veg-o-matic’s picture

And I do run update.php but nothing actually updates (progress bar shows 0 of 0 updates.) If I go to selling.com and create a page, the same page shows when I go to wahoo.info (and vice-versa). Both sites seem to be using the same database (and www.wahoo.info shows on the home page of both sites) and I can't figure out why, since each database is specified in the proper settings.php.

Arrrgh!

zbricoleur’s picture

Hmm, that should actually read:

Now you can go to http://www.mysecondsite.com/install.php and run through the implementation to populate your new Drupal site database

Not convinced that's the real problem, though, since Drupal 6 should kick you over there automatically if you go to http://www.mysecondsite.com

Cybergarou’s picture

That could make the difference. Since this isn't a new site, just an additional site within an existing site, Drupal 6 isn't going to run the install script.

I'm leaving town in a couple hours so if this isn't resolved by the time I get back I'll take a closer look at this.

Cybergarou’s picture

I ran through the instructions at http://drupal.org/node/516608 and tried to setup Drupal 6 with a multi-site configuration. It didn't work and looking at some of the other instructions out there it looks like the instructions you were following don't even apply to Drupal 6.

That's not the only problem however. No matter what I try I can't get multiple sites working with one code base. I run into the same problem that you see, only the old site shows up and I never get the installation for the new site. There is some aspect of the server/network configuration that is not mentioned in any of the instructions. (Something a lot of people take for granted I bet.)

Since you are making two different sites I'm going to suggest that you make two completely separate Drupal installations. It's MUCH easier to setup and the amount of time spent maintaining two separate installations is almost the same as a multi-site containing two sites.

veg-o-matic’s picture

Man, thank your for validating what was happening to me! The instructions were so simple and so straightforward that I assumed I was doing something just plain old stupid. After I tried it a few times (what's that definition of Insanity again?) I determined that I was doing everything by the letter and it still wasn't working.

I know we're going to want to have more than two sites but for the time being, I'm good with multiple installations of Drupal. In fact, I think I may prefer it that way. Yes, using multisites makes maintaining things a little easier (though not that much, to be honest), but I think there's some value in having things separate. For instance, if one site blows up, the rest of them won't. Necessarily ;)

veg