Multisite Setup Locally with Drupal 7 / MS SQLSRV / IIS 7.5

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
katannshaw's picture

Drupal 7 / MS SQLSRV / IIS 7.5 (on localhost)

I'm trying to create a multisite setup on my localhost account with Drupal 7, and it's not been as easy as I had hoped. The biggest issue is that all of the tutorials on setting it up are for Apache and/or hosted setups.

This is what I need:

http://localhost (main install)
http://localhost/site1
http://localhost/site2
http://localhost/site3

Does anyone either know of a great tutorial or documentation on how to do this? If not, some basic steps on accomplishing this would be great. Thanks for any help.

Comments

alexpilotti's picture

Hi,

the easiest way is to use Web Platform Installer (WebPI).

Start it, choose "Acquia Drupal" and let it retrieve al the dependencies for you.

We did a great workshop at DrupalCon Denver about Drupal on Windows. You can find the complete slide deck here.

Basically what you want to do is creating separate web applications inside of your default web site. You'll find everything explained in the slides.

let me know if you need further infos!

Alessandro Pilotti
MVP ASP.Net / IIS

Hi Alessandro, I was able to

katannshaw's picture

Hi Alessandro,

I was able to get Acquia Drupal installed a few months ago after some trial and error. It's been going fine, and I've been able to learn a lot about Drupal in that time.

I now just want to create 3 sub-sites of the main site so that I can try out some different setups. I want each to have their own database copy of the original

I'd like all three sites to use the core files and contributed modules at site/all/modules, but I'd like each site to have its own database within SQL Server.

I looked through your referenced slides and couldn't find these instructions, although I did see a very cool (and above my head) web farm setup. Shouldn't this process be easy to do? Thanks for your help.

The "Multi-site on

romeljacinto's picture

The "Multi-site on Windows-IIS" article is a good place for reference.

https://drupal.org/node/554336

Hey rjacinto, I went to that

katannshaw's picture

Hey rjacinto,

I went to that documentation and followed those steps, but when I went to http://localhost:12345/site1/install.php, I was directed to the main site I've already created with a HTTP 403 error.

The sub-site is located at: sites/localhost/site1 as instructed. The port# is what was assigned to my install through Web Matrix.

I didn't see any part in this instructions on copying over files in the main "Drupal 7" directory like install.php, so I'm not sure why it's saying that I should go to that install page.

Do you have any suggestions on what I'm doing wrong? Thanks.

Ok, still no success on

katannshaw's picture

Ok, still no success on setting up multisites for me. I'm hoping that someone can help me to figure this out. This is what I've done so far:


1) Created 3 empty databases on SQL Server 2008 Express on my local machine in the same location as the main Drupal DBwithin MYCOMPUTERNAME\sqlexpress2008:

DrupalSite1
DrupalSite2
DrupalSite3

*Note: All of these use the same DB login/user as the main Drupal DB.

2) Created 3 site folders in the "Drupal 7/sites" folder:

localhost.site1
localhost.site2
localhost.site3

*Note: I have full rights to all three folders. Each of these contains a files folder and a settings.php file with their respective database settings.

3) Updated the Windows host file with the 3 sites:

Before:

123.0.0.1 localhost

After:

127.0.0.1 localhost
127.0.0.1 localhost.site1
127.0.0.1 localhost.site2
127.0.0.1 localhost.site3

4) Added 3 sites to sites.php file in "Drupal 7/sites" folder, like this:

$sites['localhost.site1'] = 'localhost/site1';
$sites['localhost.site2'] = 'localhost/site2';
$sites['localhost.site3'] = 'localhost/site3';

*Note: Is this correct?

5) Created 3 virtual directories using IIS manager:

Name: localhost.site1
Path: C:\Users\USERNAME\Documents\My Web Sites\Drupal 7

Name: localhost.site2
Path: C:\Users\USERNAME\Documents\My Web Sites\Drupal 7

Name: localhost.site3
Path: C:\Users\USERNAME\Documents\My Web Sites\Drupal 7

*Note: When I click on the "Test Settings..." button, "Authentication" works, but I receive this message next to "Authorization":
"Cannot verify access to path (C:\Users\USERNAME\Documents\My Web Sites\Drupal 7)."

The detailed message says:
"The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that \$ has Read access to the physical path. Then test these settings again."

I checked the security for all of the Drupal folders, and I have full rights to all of them through my network login and through my computer.

6) Tried going to two paths for site1: http://localhost.site1/install.php and http://localhost/site1/install.php. Both resulted in this error message:

Forbidden

You don't have permission to access /install.php on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


Any help would be appreciated. I'm pretty stumped at this point on how to proceed.

EDITS:

Issue #4: After reading a comment from kpastore on this article (http://groups.drupal.org/node/121629), I changed the sites.php file to use this:

$sites['localhost/site1'] = 'localhost.site1';
$sites['localhost/site2'] = 'localhost.site2';
$sites['localhost/site3'] = 'localhost.site3';

Issue #5: I fixed #5's specific issue using this article:

http://amastaneh.blogspot.com/2011/04/authorization-cannot-verify-access...

Now the virtual directories show no errors...yea! But I still cannot run the install.php file at http://localhost.site1/install.php and http://localhost/site1/install.php

@jayhawkfan75 Sorry for the

romeljacinto's picture

@jayhawkfan75

Sorry for the delay; I've been busy.

  1. The site aliases in sites.php don't include hostnames for "localhost.site#".

Either include the "localhost.site#" in sites.php or do not use "localhost.site#" at all.

If it were me, I would keep things simple and would comment out or remove the "localhost.site#" entries.

  1. Have you checked Windows permissions on the "C:\Users\USERNAME\Documents\My Web Sites\Drupal 7" directory?

Thanks for responding

katannshaw's picture

Thanks for responding rjacinto,

Concerning using localhost.site instead of site, all of the different articles I've read on how to set things up said that I should include localhost.site1 as the name, which is why I had it set up that way.

I removed "localhost" from all of the names in all files (including the host file) to see if that made any difference, which is didn't. Here was the error I get when trying to view the page:


Forbidden

You don't have permission to access /install.php on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 Server at site1.com Port 80


I received this error whether the site was named "site1" or "site1.com" when trying to view the install page: http://site1/install.php. I also looked at the security of my "Drupal 7" directory, and all accounts have all read/write rights. Since it's on my local machine, there are only 3 accounts listed: SYSTEM, me, and MYCOMPUTERNAME\Administrators.

I never received this error on the initial install, which used the same "Drupal 7" folder. This leads me to believe it's an error in how I have it set up somewhere else, and not a permissions issue. But I could definitely be wrong. Any more help would be greatly appreciated. Thanks.

This should work fine for

memmons's picture

This should work fine for your sub applications:

$sites['localhost.site1'] = 'localhost.site1';
$sites['localhost.site2'] = 'localhost.site2';

I usually create new sites for each site we have in production to make it easier to manage. This is pretty simple just make a new entry in your host file and then setup a new site in IIS using a new app pool. It works for me every time.

host file:
127.0.0.1 site1.local
127.0.0.1 site2.local

sites.php:
$sites['site1.local'] = 'site1.com';
$sites['site2.local'] = 'site2.com';

If for some reason it is still not working then remove the setting.php file from "sites - all - default" directory and put it into your site name's folder to see if that will work. Make sure the naming is exact, that is where I have run into issues.

The latest error message

romeljacinto's picture

The latest error message you've provided is confusing me a bit.

It's an error generated from Apache, however I thought you were trying to use IIS.

Can you please confirm your IIS configuration?

Forbidden

You don't have permission to access /install.php on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 Server at site1.com Port 80

Yes, I have it set up using

katannshaw's picture

Yes, I have it set up using IIS 7.5. I thought that it was strange that "Apache" appeared there as well.