By Peter Bell

Improving Hosting 3: Web server - Apache or IIS 6/7?

The next question we're considering as part of upgrading our hosting infrastructure is what web server to use - IIS or Apache . . .

Given that we've decided to use Linux web servers, it's pretty clear we'll be running Apache, but I wanted to take a little bit of time to highlight why we had decided to move to Apache - even if we had kept running Windows servers.

As with Windows, we've been using Internet Information Server for a really long time and only started playing with Apache for development when we moved to Mac laptops in June of last year. While IIS has been getting better over time (and IIS 7 is just around the corner), we have been unable to come up with any compelling reasons (for us) to use IIS. I'm sure that if you had a heavy ActiveDirectory infrastructure and were developing intranet apps there might be some synergies, but for developing front end web applications, we really don't seem to get anything from IIS except for problems.

In particular, provisioning of IIS sites automatically has required us to write a .NET web service to provision new sites. In Apache we could do the same just by writing to some text files. With CF8's closer .NET integration it would be easier for us to just create a component for managing IIS sites and to invoke that directly within CF, but with no compelling benefits, we've decided to move to Apache and simplify our infrastructure.

Most developers I know who work with both Apache and IIS prefer Apache (although I saw that Microsoft is kicking off an IIS 7 roadshow, so it would be interesting to see what they are coming up with). In fact, I have not yet spoken to anyone who unreservedly (or even reservedly) recommended IIS over Apache. Anything we're missing? Any dark secrets we haven't figured out re: Apache or shining benefits of IIS we're ignoring at our peril?!

A perfectly reasonable follow on question might be why we decided to make this a two horse race. There are many web servers out there that we could have considered. The answer is that we were looking for a good enough, mainstream, easy to maintain and configure web server with a large user base and Apache fitted that need. We'd probably use a different server if we wanted (for instance) a server optimized for serving static files, but there seemed to be enough Apache experience in the CF world that it wasn't a big risk and would provide substantial benefits for us over IIS in terms of the simplicity of generating new sites.

Thoughts?

Comments
I'm uncertain what this post is all about. Previous posts, you mentioned that you've finally decided to move everything over to CentOS which I had assumed apache.

It's obvious that you want your internal (dev/staging) / external (production) to be as close as possible. I run apache at home on both windows / linux with cf8. I'm willling to take that risk of my OS not being the same and I know I have to fix or account for path issues programmatically. Plus, don't forget about everything now being case sensitive (which, isn't an issue for me since I have everything lower / camelCase to begin with) on Apache and SES (e.g. /news.cfm/2008/01/01/) is a little more difficult to setup.

This isn't really a continuing discussion in your "Improving Hosting" series, this is taking a step back on what we, the readers, thought you've already decided on. You can't decide "CentOS" and then go, "Oh, but what about IIS?" You decide what webserver you're catering towards first, then decide on what OS. So, this post basically nullifies the Linux Distro post along with opinions, especially if you decide to stick with IIS.

Just saying.
# Posted By Todd Rafferty | 8/31/07 11:21 AM
Hi Todd,

The truth is that no technical decision is completely linear. There are many dependent decisions that move towards a final choice. I think it would be fair to say it would be better to have had the IIS/Apache post before the OS post, but I think there are going to be enough interactions throughout the series that I may reverse earlier decisions - no harm/no foul as long as I make the changes before I start buying software!

For example, what about email or FTP software? On the one hand it'll be easier to cut down on the list of software if I know the OS, but what if there is a compelling reason to use a piece of software which comes out of that discussion and then affects the OS choice?

Fact is I am still planning on Linux as IIS isn't sufficiently compelling to overturn my OS choice, but when I get onto MySQL vs Postgres vs SQL server, who knows what implications that will have? I'd rather only run a single OS if possible, but if I choose to run SQL server on Windows I might be more open to a windows based email or FTP solution as I'd already have committed to having two operating systems to maintain . . .
# Posted By Peter Bell | 8/31/07 11:45 AM
Seems pretty linear to me I guess. You need to decide what programs are going to be in your vast collection of resources first before deciding what OS you're because that will make/break your OS decision. IIS on CentOS just isn't going to work and just in case someone hacked it or wine'd it to work, it probably won't work as well as base install of Apache on CentOS. web/email/os is probably the major discussions with os being last because web/email could possibly swing the vote for os.

If your company isn't opposed to running a mixed operation, then more power to you, but that was't really discussed in the post and a new user stumbling onto your blog is going to read your posts in this order:
* "Hrm? Apache or IIS?"
* "Ok! I decided on Centos!"

They're going to think you're waffling. Which, by all means, is your decision to waffle. :)
# Posted By Todd Rafferty | 8/31/07 12:18 PM
After spending a week trying to install Apache under Windows and make it do almost everything, I say Apache is just the better choice. Here is why I chose to use it over IIS:
1. Same environment setup for both dev and prod
2. Multiple websites even under Windows XP
3. Subversion integration
4. Number of modules available (mod_rewrite here I come)
5. Running other languages without much hassle (so far I got PHP, Perl, Ruby on Rails, JSP and CF)

I mean to write a guide on all that since it was such a pain to setup.

The only caveat is that I cannot run .NET apps but from what I hear there is a module either coming out or in the works. Either way, I can always run IIS on an alternate port and just use mod_proxy. I don't think I have such option with IIS to proxy to Apache under the default config.
# Posted By Boyan | 8/31/07 11:12 PM
I forgot to mention NTLM authentication is also possible with Apache for both Windows and Linux. There is a module called mod_sspi that makes it happen under Windows. One more reason, switching to Apache is no hassle (after the damn initial setup anyway).
# Posted By Boyan | 8/31/07 11:13 PM
on Boyan's Post:

1) can do this with iis
2) can do this on iis using host file (which can be generated)
3) not necessary, but if you want it it's easily setup
4) same with iis
5) same with iis if you know what you're doing

I think a lot of people ate the linux freeware cake and took a side serve of propaganda. Likewise the Windows nerds pay close to nothing for windows server and took a side serve of propaganda also. There is nothing that either operating system can do that the other can't, this has been emphasised even moreso by the open source community that builds extensions for both communities, although due to political decisions the linux community has fragmented into various builds making it harder to obtain particular modules for common builds.

If you use control panel software, like Plesk or alike, your management is completely minimised whatever you use. You can get free five customer licences too. At the end of the day to run an ISP efficiently you need automation, otherwise you need more hands on deck. This also makes the apache/iis decision trivial. Do you have the develpers to code automation in linux, windows, apache, iis? Who is easier to find when your developer moves on/ gets seriously sick?

You can also use tools such as the IHTK from intrafoundation to automate creating sites and virtual directories (works great on 2k and 2003 server. We use this kit so keep our development, test and production servers in sync... same environment.

You can no longer say linux is better than windows, iis is better than apache etc as all of them are stable these days, all of them can have security holes if you don't manage them and all of them can do what the other can do. It's just a matter of what your market wants.

There are also programs out there that allow you to run .net on linux.
# Posted By Chris Dawes | 9/2/07 9:46 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.005.