I have setup my various config files for each of my sites per instruction in the Drupal INSTALL.txt file. However, I cannot find anyway to access these other sites, just the main (sites/defualt) site. What do I have to do now to make these other sites accessible? I am using Drupal 4.6.0.

Comments

beate_r’s picture

There is are several discussion threads dealing with this issue. See for example. See for example

http://drupal.org/node/20663

Basically You need name resolution for each site, setup the directory structure in sites according to the instructions in INSTALL.txt, sites/default/settings.php, or the manual, and use either different databases or one single database with table names prefixed by $db_prefix
For clarity, i suggest to use unique a name prefix also for the set of tables belonging to the default (i use main_). The database files must be edited individually for each instance either manually or by a script. And of course each of the sites must be initialized individually. You will find details to all of this in the ongoing discussions and might also have look into into the configuration section of the manual.

I hope that will already help You. Otherwise feel free to ask once again.

cheers,

Michael

x86eon’s picture

I undersatnd the config file setup part, but what I don't understand is to how to get the seperate sites to actually exist. For example, I set up a new folder in the sites directory with a new config.php file, and name the folder example.com.drupal.test, but when I go to http://example.com/drupal/test, Drupal gives me a Page Not Found error. I don't know if this matters or not, but the config files are both identical, because I'm trying to setup a alias to the main site in the directory test.

beate_r’s picture

Maybe its easiest to document the setup i do my tests on:

My machine - laptop not necessarily on the net - has two names pointing to the same IP address, say bromo and beate. Both defined locally in /etc/hosts, but of course any kind of name resolutin can be used. For a server available in the net, You will hav to use a FQDN, of course.

My web-server (apache-ssl) has no virtual hosts enabled and alsd has ServerName unset. So the the ServerName is derived from name resolution.

The documentRoot is /var/www
Drupal is installed in /var/www/dupal46.
/var/www/drupal46/sites has two subdirectories: default and beate

Drupal uses one single database - name drupal46. In order to be able to use different content with one single database i use two different sets of tables -
$db_prefix = 'main_' associated with setting default and
$db_prefix = 'beate_' associated with setting beate

In both cases $base_url is set to a relative path - the directory drupal is installed relative to the document root: /drupal46

So, https://bromo/drupal46 points to the default setup and https://beate/drupal46 points to the beate setup.

If I had an official FQDN for that secondary site (beate) , say pustekuchen.homlinux.net, You will have to use a symbolic link in
/var/www/drupal46/sites :
pustekuchen.homelinux.net -> beate
and can access beate also with this FQDN.

To Your example: if You want to access Your sites by
http://YOUR-SITE/drupal and http://YOUR-SITE/drupal/test You will probably need to setup a subdirectory test in sites/default and provide an appropriately configured settings.php in this subdir.

cheers,

Michael

squiggy’s picture

I believe I have done everything described in install.txt and am having the same problem x86eon described. I am only able to access the site defined under sites/default/settings.php. Besides creating a separate settings.php file with its own directory, what else do I do? I am using the drupal 4.7.1 and I am setting this up on a subdomain like this: site.example.com/cms. However, the installation of drupal is on a separate domain hosted on the same server. The line in the settings file looks like this: $base_url = 'http://www.site.example/cms'. And this is how the directory is named in the drupal installation: sites/site.example.com.cms/settings.php. What am I missing?

rbowen’s picture

After working on this for an inordinate amount of time, I have, I believe, realized what I needed to do. The (in your case) 'test' directory needs to be a valid content directory. I thought it was somehow magical.

So, in your 'drupal' directory:

ls -s . test

That is, make 'test' a link to the drupal directory, so that it has access to all the drupal code in that "test" subdirectory. Do this for each subsite that you want to create.

jenlampton’s picture

I think you meant:

ln -s . test

kilna’s picture

I just solved this exact problem when running PHP under FastCGI on the lighttpd web server. The trick is to add cgi.fix_pathinfo=1 into your php.ini file. PHP will only properly set PATH_INFO *or* PHP_SELF, and Drupal uses PHP_SELF... but the default (at least in my debian distro) was to set PATH_INFO properly. It would be nice if Drupal was written to use the default behavior of PHP. :P

julma’s picture

Hello, My case is very simple, I just want to run on my own machine two sites with the same drupal installation . Each site has its own database dbtest1 and dbtest2. My drupal installation is located at www/drupal. I have edited two settings.php files. The first is in www/drupal/sites/site1 and the other is in www/drupal/sites/site2. I d like to access this sites at
http://localhost/drupal/site1 and http://localhost/drupal/site2

In site1/settings.php I have set $db_url = 'mysql://root@localhost/dbtest1'; and $base_url = 'http://localhost/drupal/site1';

In site2/settings.php I have set $db_url = 'mysql://root@localhost/dbtest2'; and $base_url = 'http://localhost/drupal/site2';

I'm using drupal-4.7.0-beta4
I m using wamp5 1.4.4
Server Configuration
Apache version : Apache/1.3.33 (Win32)
PHP version : 5.0.4
MySQL version : 4.1.10a-nt - extension : mysqli

I ve tried the trick you've mentionned so I've added "cgi.fix_pathinfo=1" at the end of my php.ini but it doesn't work.

Otherwise, I have no problem to run drupal with the default settings for only one site.

I need help, please...

Ken Collins’s picture

I am trying to do exactly as kix describes and all the logical things are in order. I wonder if the rewrite rules need to be expanded to account for this directory?

Ken Collins’s picture

I was correct, at least for me. It did have something to do with the rewrite rules. Basicaly my site2 (meta-them-for-drupal) was a sym link at the root of the main site and I had a mathcing settings to go along with it. So all I had to do was add another group of drupal rewrite rules to Lighty (BEFORE) my standard Drupal root rules. So I ended up with something like this.

 url.rewrite-once = (
   #Rewrite Rules for Additional Site
   "^/meta-theme-for-drupal/system/test/(.*)$"  => "/meta-theme-for-drupal/index.php?q=system/test/$1",
   "^/meta-theme-for-drupal/search/node/(.*)$"  => "/meta-theme-for-drupal/index.php?q=search/node/$1",
   "^/meta-theme-for-drupal/([^.?]*)\?(.*)$"    => "/meta-theme-for-drupal/index.php?q=$1&$2",
   "^/meta-theme-for-drupal/([^.?]*)$"          => "/meta-theme-for-drupal/index.php?q=$1",
   # Rewrite Rules for Root Site
   "^/system/test/(.*)$"        => "/index.php?q=system/test/$1",
   "^/search/node/(.*)$"        => "/index.php?q=search/node/$1",
   "^/([^.?]*)\?(.*)$"          => "/index.php?q=$1&$2",
   "^/([^.?]*)$"                => "/index.php?q=$1"
   )
redvespa’s picture

Kix, I'm trying to do exactly what you we doing in you post (February 15, 2006) and I'm wondering if you got it working.

There is soooo much chatter about mutisite support but nothing seems like a complete answer. The note in the install.txt end with you having site directories with domain names, with a settings.php file but that doesn't complete multisite setup.

I'm thinking that there are .htaccess issues and other web server details that I'm missing (and the install notes should be refering to)

Can you help?
Thanks

rivena’s picture

Please avoid playing with htaccess unless you have to!

The missing part is, your site has to know where to go! If you know how to edit apache conf, then that is one way. Change the document root of your multi site to your drupal install.

If you know how to make a symbolic link, that is another way.

Please search the forums for more details on those specific things, I am not very technical, I had my host make a symbolic link for me, and I would hate to tell you the wrong thing. One thing with symbolic links is if you make one, the folder for your multi site (the one with NO drupal files in it) will no longer be able to store any files, so please back it up before you try this.

Anisa.
PS: I am working on multi site docs, so if you find a solution, please post it here, and I can use incorporate it!

-----------------------------------------------------------
Kindness builds stronger bonds than necessity.

www.animecards.org - 18,000 card scans and counting!
-----------------------------------------------------------

jenlampton’s picture

Yes, you have to set up your conf to point to the sites, but more importantly, there actually have to be FILES in those direcotries for you to see anything. Don't we need to copy index.php (or something) into www.domain.com?

And what about the other databases (or tables within the database - if you choose to set it up that way)? The install.txt file left out that you need to set up the other databases (or it just assumed we would be smart enough to figure that out) before you change the settings.php file to call something nonesitstant.

Could someone please tell me (or post) what's supposed to be in the www.domain.com directory?

Jen

rivena’s picture

What do you mean by what file should be at www.domain.com? I don't understand?

Your drupal installation should be installed in one place. One drupal installation can handle the settings for as many other multi sites as you like. You have to set up the tables, configure settings.php, and do the pointing for each multi site you do, but IN the multisite, there does not need to be any files. Drupal handles the whole thing, based off the approprially configured settings.php.

How you set up the databases really depends on you. If you want completely separate sites, then of course, each site needs its own set of databases. I can't comment on the install.txt.

Anisa.

-----------------------------------------------------------
Kindness builds stronger bonds than necessity.

www.animecards.org - 18,000 card scans and counting!
-----------------------------------------------------------

Seneschall’s picture

Okay, here's my own personal setup...

I got a domain. www.domain.com. Drupal is installed here. One db, that's it.
I have a subdomain. city.domain.com. This is a completely separate folder on this server. It doesn't point back to something like www.domain.com/city like my old server did. I can make unlimited subdomains, but they all have their own configuration on the server (i.e. mail setting, option to install oscommerce... yada yada... you get it.)

So... as an expert in old school CMS's like phpnuke & mdpro... I'm thrown aback by drupal. (this is what I get for trying something new!) How do I set up multi site on this sort of set up? I have city.domain.com/settings.php already, and I didn't change anything because I WANT the same users, same content. Only difference is I want ADDITIONAL content on city.domain.com.

First, did I do it right?

Second, What do I put on the city.domain.com folder (assuming I did it right)? htaccess? drupal folders?

Cheers in advance guys. Beers on me if you ever come to Shanghai (the "city" in question).

edit: maybe I should say at this point, I have the newest (biggest number) version of Drupal installed as of today.