Multiple IIS Sites on XP Pro

One of the things that really bugs me about IIS is that you can't run multiple web sites under XP Pro. I guess Microsoft assumes "Pros" will have an XP Server box for every developer. This is the main reason I use Apache on my dev box and my laptop.

A coworker pointed me to an ISAPI filter called MultiSite. You can find it here. I haven't tried it yet, but it seems like the perfect solution.

Archived Comments

Comment 1 by Webdump posted on 12/27/2004 at 8:07 PM

IIS (with or without this plugin) can't be a perfect solution. Apache is the way.

Comment 2 by Raymond Camden posted on 12/27/2004 at 8:22 PM

Well, I love Apache, especially it's URL Rewrite ability, but it has one HUGE issue for me. You can't override the 404 error for CFMs. What I mean is, if I request xxx.cfm, and it doesn't exist, I get CF's builtin 404 error. In IIS, I can tell it to check for script existence, and this allows me to properly trap 404 errors. I have yet to see a way for Apache to do this.

Comment 3 by jared chandler posted on 12/28/2004 at 12:57 AM

can't you simply have apache rewrite all .cfm requests within a site through a single .cfm file? I assume this is for a CMS or something similar.

Comment 4 by Raymond Camden posted on 12/28/2004 at 1:08 AM

That isn't a fix, that's a hack. Also, it won't work for existing sites. It should be rather simple. If someone request a file that does not exist, I should be able to trap the error. This is easily done in IIS. It is impossible in Apache, and I've yet to hear a good reason for it.

Comment 5 by jared chandler posted on 12/28/2004 at 2:15 AM

i just added:
ErrorDocument 404 template.cfm

and that seems to trap for missing .CFM's.

Comment 6 by Raymond Camden posted on 12/28/2004 at 2:23 AM

What version of Apache are you running? That has never worked for me.

Comment 7 by jared chandler posted on 12/28/2004 at 2:32 AM

1.3.26. My setup is kinda screwy (apache proxy to IIS, so I'm sticking CFMX 6.1 on a clean debian box to make sure. I've wanted to get this licked under *nix for a while.

Comment 8 by Raymond Camden posted on 12/28/2004 at 3:58 AM

I'm using 2.x, I bet that is the issue.

Comment 9 by balthor posted on 12/28/2004 at 5:09 AM

Here is my personal favorite:

http://www.firstserved.net/...

Comment 10 by jared chandler posted on 12/28/2004 at 9:13 AM

ok. the solution*:

1) Build apache (in this case 1.3.31) with mod_rewrite support:

$ ./configure --prefix=/path/to/apache \
--enable-module=rewrite \
--enable-shared=rewrite
$ make
$ make install

2) Add the appropriate LoadModule call to httpd.conf:

LoadModule rewrite_module libexec/mod_rewrite.so

3) make a directory off root (in this case "stuff"), and add an error handling template named error.cfm. I just stuck a <cfdump var="#cgi#"> in it.

4) make a .htaccess file with the following:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /stuff/error.cfm

5) restart apache and throw some urls at it.

6) Problems: All the CGI variables are blank. There should be some further fiddling with mod_rewrite which will let you copy over the various cgi setting, but that's for another night.

Comment 11 by jared chandler posted on 12/28/2004 at 9:26 AM

a mod to get the querystring:
Put this in .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /stuff/error.cfm?%{REQUEST_URI}

Comment 12 by Raymond Camden posted on 12/28/2004 at 5:38 PM

Thing is - though - wouldn't it be better to run on Apache 2.x? I always assume the latest and greatest version is the one to run.

Comment 13 by jared chandler posted on 12/28/2004 at 8:24 PM

i think it would work exactly the same on apache2. i think i was running 1.3.31 because something (php maybe but who knows) didn't like 2.0. You should be able to find your httpd binary and httpd -l to get a list of modules compiled into it. If mod_rewrite is in there, and you can located the .so somewhere, you should be in business out of the box.

Comment 14 by anthony petruzzi posted on 1/3/2005 at 11:55 PM

See this is exactly what I have been saying for years with this Apache vs. IIS debate.

Did you noticed the solution that jared chandler wrote above for your template problem? Kinda of a monster isn't it.

All I know is when I'm developing I need to work, not screw around. IIS is simple to install and simple to get working. Apache has always been a PITA for me. If you don't compile it a certain way, stuff doesn't work. Want to add something, you need to compile it again with the module. With IIS you can simply add the filter.

Personally I don't have a problem with the multiple site issue. I have a copy of Win2K Server (and yes I bough it) running in a VMWARE (bought that too) virtual machine on my WINXP box.

Comment 15 by John Farrar posted on 1/9/2005 at 10:26 PM

One thing I can't understand is why Apache has a old style config file and no "gui" admin interface. (I figure it has a nice GUI admin interface... can anyone suggest one?)

John Farrar

Comment 16 by Jeff Wilkinson posted on 1/18/2005 at 2:53 AM

balthor, that firstServed iis admin tool you posted the link for looks great. I'd just hit this problem on a new xp-pro install so this is timely advice. I particularly like its ability to set up multiple sites, then stop and start each with a little taskbar control app. Neat!