Multi Site questions
I am confused about the multi-site feature. After reading the install.txt that came with the installation, to have multi-site capability, I would need to set up a separate folder and put in the config file. Currently I am using Windows XP, Apache, PHP 4.3 and MySQL
But how do I use drupal with that configuration?
Say, I install the root installation at http://localhost/drupal. Now I create a folder call "test" in sites folder such that the configuration file is at http://localhost/drupal/sites/test
How do i access that config file? For example, if I open up FireFox browser and type in url http://localhost/sites/test I am only seeing config file, but not the drupal webpage.
The install.txt does not show how one would do it, it is unclear. I checked Drupal forums for clarification, and there are references to htaccess, configuring apache, but it is not much help because it jump around without a solid step by step instruction on how to do it.
Is there a step by step guide that will lead the person in setting this up? Or can someone at least give a step by step instruction?
I want to be able to use this CMS.
Thanks in advance.

multiple domains configuration example
you need to register the domiain "test" on your apache box to point to your drupal install
I know sounds weird..
example of my setup:
my drupal install is on /data/drupal
and my apache config file looks like this for the diferent domains:
<VirtualHost 66.135.34.48:80>
ServerName mydomain.com:80
ServerAlias www.mydomain.com
UseCanonicalName Off
SuexecUserGroup mydomain psacln
ServerAdmin mydomain@email.com
DocumentRoot /data/drupal
</VirtualHost>
<VirtualHost 66.135.34.48:80>
ServerName mydomain2.com:80
ServerAlias www.mydomain2.com
UseCanonicalName Off
SuexecUserGroup mydomain2 psacln
ServerAdmin mydomain2@email.com
DocumentRoot /data/drupal
</VirtualHost>
see all domains on the server point to the same root in this case /data/drupal
and my config files are at:
/data/drupal/sites/mydomain
and
/data/drupal/sites/mydomain2
*just make sure you have .htaccess in your folder..
I hope it helps
Configuration example....
So to use your example to work for my question, I would do do the following....
---------------------------------
ServerName localhost:80
ServerAlias http:\\localhost\drupal
UseCanonicalName Off
SuexecUserGroup localhost\drupal all
ServerAdmin mail@localhost.com
DocumentRoot \localhost\drupal
ServerName localhost:80
ServerAlias http:\\localhost\drupal\test
UseCanonicalName Off
SuexecUserGroup localhost\drupa\testl all
ServerAdmin mail@localhost.com
DocumentRoot \localhost\drupal\test
----------------------------
and the above configuration file goes into httpd.conf? or just only for '.htacess' ?
How does this allow me to access the root installation at http:\\localhost\drupal, and then access the branch "test" at http:\\localhost\drupal\test and at the same time drupal telling the difference which configuration file to use?
I think i understand how the drupal configuration file works, I can set up a separate database for branches i make, and I think i can set the variable $base_url to the url i want visitors to type in.
For example, the variable $base_url = 'http://localhost/drupal/test';
The above example will allow visitors to type http://localhost/drupal/test in the web browser.
Am I going about this correctly?
Can you use my example to explain it to me? I would appreciate it.
Thanks in advanced.
One way of doing it
If you want http://localhost/drupal and http://localhost/drupal/test to use the same Drupal install but separate databases, you can do the following:
Install Drupal so it's accessible at http://localhost/drupal.
Change the settings in sites/default to match the first site:
$base_url = 'http://localhost/drupal';$db_url = 'mysql://testuser:testpass@localhost/drupaldb';
Edit httpd.conf and add the following line (change d:/wwwroot to whatever your DocumentRoot is set to):
Alias /drupal/test "d:/wwwroot/drupal"Copy your sites/default/settings.php file to sites/localhost.drupal.test/settings.php and change the settings to match the second site:
$base_url = 'http://localhost/drupal/test';$db_url = 'mysql://testuser:testpass@localhost/testdb';
Restart Apache and you should be ready to go.
I've tested this with Apache 1.3.x / PHP 4.3.x.
If you want to use separate hostnames you can do something like:
Add the following to c:\winnt\system32\drivers\etc\hosts
127.0.0.1 foo.local127.0.0.1 bar.local
Copy your sites/default/settings.php file to sites/foo.local/settings.php and change the settings to match the first site:
$base_url = 'http://foo.local';$db_url = 'mysql://testuser:testpass@localhost/foodb';
Copy your sites/default/settings.php file to sites/bar.local/settings.php and change the settings to match the second site:
$base_url = 'http://bar.local';$db_url = 'mysql://testuser:testpass@localhost/bardb';
Add the following sections to your httpd.conf (simplified):
<VirtualHost *>
ServerName foo.local
DocumentRoot "D:/path/to/drupal"
</VirtualHost>
<VirtualHost *>
ServerName bar.local
DocumentRoot "D:/path/to/drupal"
</VirtualHost>
Restart Apache and your two Drupal sites are available at http://foo.local/ and http://bar.local/
Much clearer!
ah-ha! got it. You do a great job in explaining it, I was able to get multi-site on the first try.
Thank you.
One last question...
I am interested in eventually create a website that will allow user to register and "automatically" get their webpage once they register.
Since httpd.conf require restarting, is there any other way to make the changes to the confuration without restarting the web server?
Hope I don't sound like a noob here...
Is it possible to do any of this through an htaccess? I installed drupal in the root of a subdomain and now I can't figure out how to tie five other domains to it.
So I have it installed in:
drupal.domain1.com
I gather from the install instructions that I need to place my desired setting structures in:
drupal.domain1.com/sites/day.domain1.com/settings.php
drupal.domain1.com/sites/afternoon.domain1.com/settings.php
drupal.domain1.com/sites/night.domain1.com/settings.php
Is that right? And if so...how the heck do I tell day.domain1.com and her fellow pages where to look for info?
I have root access, but haven't done anything more than setting cron jobs with it.
Hope I haven't thrown the topic off course. I appreciate any advice! ~KB