I am brand new to Drupal, and have successfully installed Drupal on a local server for internal testing. I have a lot to learn that is mostly a matter of time and trial. However, I can't get one thing working that I really do want, and that's the multiple-site feature. I have followed the installation handbook, but I'm not clear exactly what the settings.php file should read for the second site. I am sure I am missing something really simple, but it's not coming to me.

I am working with Win2K, Apache 2.0.48, PHP 5.0.0. The web directory is inherited from IIS, and is inetpub/webroot. In webroot, I copied the entire drupal-4.6.5 tree as its own directory (webroot/drupal-4.6.5). In sites/default/settings.php, I modified base_url to: http://newmother/drupal-4.6.5, and the default site (at http://newmother/drupal-4.6.5) is working. Now, trying to create a second site, I added a test directory in the sites directory, and copied the default/settings.php. In this file, I set base_url to: newmother/drupal-4.6.5/test, but it doesn't work. What am I missing?

TIA,
David

Comments

GSMKer_Kevin’s picture

I'm familiar with Win2k and Linux however I haven't tried a Drupal install on a Win box. I think I might be able to be of some help though? We will take it one step at a time.

What did you name the "test" folder in the sites directory? Did you name it test? If so that folder should be named newmother.drupal-4.6.5.test
I'm not sure if the "." in drupal-4.6.5 is going to be a problem? It might be worth your time to get your Drupal install working with newmother/drupal

In either case the next step then will be to link your second site to your base install. This will be the interesting step on a Win box. Before doing this though we want to make sure your setup is solid. I recommend taking the time to change your base install to /drupal if you don’t want it at the root of your site.

Let me know how you proceed and then we will take the next step!

gsmk.com
The only barriers that exist are the ones we create!

jbrauer’s picture

From the settings.php file:

* For example, for a fictitious site installed at
* http://www.drupal.org/mysite/test/, the 'settings.php'
* is searched in the following directories:
*
* 1. sites/www.drupal.org.mysite.test
* 2. sites/drupal.org.mysite.test
* 3. sites/org.mysite.test
*
* 4. sites/www.drupal.org.mysite
* 5. sites/drupal.org.mysite
* 6. sites/org.mysite
*
* 7. sites/www.drupal.org
* 8. sites/drupal.org
* 9. sites/org
*
* 10. sites/default
*
* If you are installing on a non-standard port number, the ':' is
* replaced by a '.'. For example, http://www.drupal.org:8080/mysite/test/
* could be loaded from sites/www.drupal.org.8080.mysite.test/.

If you have a sites/test/settings.php file won't be searched according to this information unless it was for http://example.test/. The directory would need to be named sites/newmother.tld.drupal-4.5.6.test or at the very least sites/tld.drupal-4.5.6.test. (tld in this case is your top level domain i.e. com, org, info etc.)

I haven't experimented with how Drupal handles the directories if they have periods in their names. It may munge drupal-4.5.6 into thinking the URL is drupal-4/5/6.

For this and a couple of unrelated reasons (like preventing script kiddies from easily knowing what version you're running) on changing the directory and URL to drupal instead of drupal-4-6.5.

---------------------------
Adding Understanding

--

sunfish62’s picture

OK. I stripped out the "-4.6.5" in the directory name and the settings files. The default install is still working, and the extra site is not. I have renamed the sites/test directory as sites/newmother.drupal.test (because this is an internal server, I have no tld), and this has not worked.

Further advice?

GSMKer_Kevin’s picture

That is correct. It won't work just yet. If you have everything else set up correct then this last step should work. However because your on a Windows box we may need to do something else? Chances are it will work.

I just realized something. Do you have the
newmother.drupal.test
domain name working? Can you type in the url in your browser and get a page? If you haven't gone into IIS and setup a site with that domain name then you need to before we do the final step. Let me know?

Sorry for delay in posting, but I was really busy today. I'll check back here later tonight and tomorrow throught the day so things move along a little faster.

gsmk.com
The only barriers that exist are the ones we create!

sunfish62’s picture

I'm running Apache 2.0.48 under Win2K. The installation was IIS, but I moved over to Apache a while back. Are there domain setup issues within Apache that I have to configure?

The domain doesn't work. I was trying to get the site running as a directory under drupal/sites, which has worked in other situations (i.e., if I am working on the foobar website [in the foobar directory], the url newmother/foobar always worked.)

GSMKer_Kevin’s picture

Dam! I know not to assume. Plus you stated what you were using in first post. Sorry about that.

It is great you are using Apache. Good job!

Ok let’s check something real quick. Then we can do that last step which should make everything work for you, if this test works?

Create a directory in your webroot. Name it "test" or whatever. Put a basic index.html file in there and see if it comes up?

Then let me know how it goes? I'll check back often so we can proceed!

gsmk.com
The only barriers that exist are the ones we create!

sunfish62’s picture

Yeah. That works. The url that works is:

newmother/test/index.html

Would it simplify things if I moved the drupal installation into the base folder (webroot), in essence making that the "default" website for my server? I was hoping to keep the old stuff running in place, but it's not essential...

GSMKer_Kevin’s picture

You can keep it where it is. Just follow my instructions.

I figured the url would work, just wanted to make sure. That told me your Apache is setup right.

gsmk.com
The only barriers that exist are the ones we create!

GSMKer_Kevin’s picture

I'm posting the final step now but don't worry about it if your simple index.html page didn't work! If it did, I would think it would then proceed!

The symlink,

This should work even though you're on a Windows machine because you have Aapche installed? Will be interesting to see If it does work, please post back and let me know. I would be interested in the result! I'm sure others would be too.

Note: the paths should be correct. They are based on the previous post. the left argument "./drupal" should point to your Drupal install directory. The right argument "drupal/test" should match the path to your second site.

Note: you're directory in sites should be: newmother.drupal.test
Base url in settings should be: http://newmother/drupal/test

1) Create a php file called whatever for ex: "symlink.php"

?php
symlink( "./drupal", "drupal/test");
?>

2) upload symlink.php to webroot

3) Change webroot permissions to 777

4) delete "test" directory from webroot. This is the directory you created from the previous post!

5) from browser type in the url to symlink.php

6) If you don't get an error, you're good!

7) You can delete symlink.php

8) Important! don't forget to change webroot permissions back to 755.

9) Give the url newmother/drupal/test a try!

Let me know?
Hope this was helpful?

gsmk.com
The only barriers that exist are the ones we create!

sunfish62’s picture

I've stepped away from my development server, so I can't tell for sure, but the PHP documentation for symlink says it is not implemented on Windows machines. It looks like you're trying to get the base drupal linked to the test directory--is that right? If so, wouldn't that force the base drupal to go to the test site at all times?

GSMKer_Kevin’s picture

No because you are not linking "Drupal base install" to test directory. You are actually just passing the url to the base Drupal install and then Drupal retireves your new site. It other words you're "bootstraping" the new site.

So you probably have everything in place so leave it like that. All you need is the equivalent of the symlink on Linux for Windows. I know it exists I just don't know off hand what the command would be on windows. I'll take a few minutes to see what I can find out and post back. If I don't find an answer quickly I'll have to wait until sometime Friday to continue this. I have client work to do.
So if I don't find the answer for you what you're looking for is a Windows command that does the same thing as the Linux symlink and then use the paths I gave you with that command. You may be able to use the same method, a php file with the command in it to create the link or you might have to do it via command line.
Hope that helps?

Let me know how it goes?

gsmk.com
The only barriers that exist are the ones we create!

GSMKer_Kevin’s picture

OK, it's going to seem like a lot but you should be able to create your link within a few minutes using the program below.

Quickly looking over some link info I would try "NTFS Link".

This page has lost of info on links. Scroll down to the section Explorer Integration with Michael Elsdörfer's NTFS Link
It will tell you how to use the program.
http://shell-shocked.org/article.php?id=284

Download the program here:
http://forge.novell.com/modules/xfmod/project/?ntfslink

Remember you create the link in your webroot. Using the program and the paths I gave you hopefully you'll be able to create the link. Get that link created right, and I bet you'll have a new Drupal site!

Let me know how it goes?

P.S. In Linux you can create an symlink in like 2 minutes. Dam Windows! I came from a Windows environment. Now I live in both Worlds, but more Linux lately.

gsmk.com
The only barriers that exist are the ones we create!

sunfish62’s picture

The symlink stuff didn't work--I kept getting a directory listing instead of a site. This may have been because the drive is FAT32 (so it can be seen and used when Linux is running), which doesn't support the same kinds of links.

So I went back and changed my directory structure so that Drupal lives in the base webroot folder. This seems to have made both URLs function (newmother and newmother/test). However, they both point to the same content, and if I change something in one (for example, the theme), the other is changed. (I am aware that there is documentation regarding implementing different themes on multiple sites, which I will delve into at a later point...ah, so many features, so little time!)

This raises the point that the various issues involved with multi-site setup aren't explained clearly in any of the Handbooks that I could find. (I especially didn't appreciate the Installation page [node 260] referring the user back to "the Drupal handbook" for more information about multi-site setup. WHICH Drupal handbook?!?!? There are 50 of them listed at the Handbooks page)

Specifically, I think there's no clear explanation of what (if anything) to do at the MySQL end. In further consideration, I imagine that each site would have to have a separate MySQL database established for it, and this would have to be delineated in the settings.php file. But I'm guessing, since the installation guide doesn't address this.

I want to thank you all (especially Kevin) for helping me wrestle with these issues. I plan to spend more time getting to understand how to work Drupal in its more straightforward presentation, and come back to this when I have a better grasp of the software in general. It is SO me to want to try every one of the most complicated features of a new software toy right out of the gate!

David

GSMKer_Kevin’s picture

Yes the symbolic link in windows needs the NTFS file system.
In Drupal you can use different databases for each site or the same database with prefixed tables. Either way you'll then have each site with it's own data.

gsmk.com
The only barriers that exist are the ones we create!

bbzed’s picture

Thanks heaps for the "NTFS link" link, was so simple to just drag and drop my drupal folder from root and then just rename it to my new site name

mjohnq3’s picture

The utility you need to create symbolic links in Windows is Linkd.exe. It is available in the Windows 2003 Resource kit which can be downloaded for free at the Microsoft web site. You can also try the free Junction.exe utility available at Sysinternals.com.

GSMKer_Kevin’s picture

Thanks mjohnq3,

I just happen to see both those programs mentioned. I thought the one I suggested above would be a nice option. It looks to be an easy gui way of doing it. I also read, I believe that the program was better in some way?

Any thoughts?

gsmk.com
The only barriers that exist are the ones we create!