Hi all,
I have successfully set-up multiple domains on a single server using Apaches vhost feature.

I have Drupal 4.2.0 successfully running on one of the domains but wish to use it on another domain on top of the same database (DB) because I guessed having only one DB running would be better performance but all my sites are low visitors anyways. htdocs = document root.

htdocs>domain1>index.php, error.php, cron.php etc etc
htdocs>domain1>database>
htdocs>domain1>includes>www.domain1.com.php (file named without www. as well as this is because told to do it in Drupal manual and also code below added:

$ ln -s includes/yourdomain.com.php
includes/www.yourdomain.com.php

$ ls -l includes/*.conf
-rw-rw-r-- 1 drupal drupal includes/yourdomain.com.php
lrwxrwxrrx 1 drupal drupal includes/www.yourdomain.com.php- includes/yourdomain.com.php

htdocs>domain1>misc>
htdocs>domain1>modules>
htdocs>domain1>scripts>
htdocs>domain1>themes>

htdocs>domain2>exact as above but changing domain where apropriate in the config filename and in the config itself

I now get a blank page on both domains. I have run down settings several times and looked around drupal.org site for FAQs or help and looked around net and forums but still no-one with the same problem as this.

I know one of you gurus out there probably has the answer and I would be much appreciated for yours or anyones help on this.

Recuerdos, Lee

Comments

kbahey’s picture

Hi Roller.

I never used PHP nor Drupal on Windows. I use them on Linux only.
However, what I am going to say is generic enough, and should apply to you without problems.

You should have both domains pointing to the same directory (for example htdocs), using DocumentRoot. You can use the DNS to point both domains to the same IP address.

Then, you create in htdocs\includes two .php files.
For example:
domain1.php
domain2.php

You should make conf.php link to the domain you want to use as a default (e.g. if someone used the IP address instead).

The contents of domain1.php and domain2.php will be identical on the database side. The only difference will be the $base_url contents.

This way, you have one database sharing the domains.
This puts some restrictions though: for example, the logo will be the same, the users and articles, ...etc. will all be the same.

If you want to have one drupal installation serving two different domains with different (and independant) users and content, then point each domain to a different database in the configuration file, or use the $db_prefix to have one database with different tables for each domain.

Of course, no one stops anyone from having two different drupal installations, each in its own directory. This is OK for like 2 domains, but for more than that it becomes a maintenance nightmare (upgrades to 4 installations, ...etc.)

Hope this helps.

Let us know how it goes ...

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

roller’s picture

Thanks for your reply,

I want the two installations 100% seperate, so that each Drupal install has it's own users, content etc.

So this will be having the seperate db route, I did try that first but got stuck on trying to import the database.mysql into my second database so porceeded with using 1 database for both Drupal installs.

My syntax that I typed using the dos prompt whilst in the mysql\bin directory, had an error in it (note I copied the database.mysql to D: to make it easier accessed and my second Drupal db was named drupaldice):

mysql -u root -p farumcop drupaldice < D:\database.mysql;

I checked my syntax and I copied it like for like from the Drupal handbook and have cross referred to my PHP & MySQL text book to make sure I'm doing it right and can't seem to get it to accept my syntax.

Thanks for your help so far and look forward to reply.

Lee