Forum Moderators: phranque

Message Too Old, No Replies

Apache vs. Microsoft's IIs

...is there that much difference?

         

Storyman

1:34 am on Dec 16, 2004 (gmt 0)

10+ Year Member



For some time all of my energy has been working with PHP/MySQL on an Linux/Apache server. I'm considering taking an assignment that will involve working with Microsoft's IIs.

What I'd like to know is if there is a great deal of difference between Apache and IIS.

Would it be worth seeing if the company would be worth switching to a new server?

Is there a downside to using IIS?

Any suggestions?

sublime1

11:27 pm on Dec 18, 2004 (gmt 0)

10+ Year Member



I have used Apache since 1998 and IIS since whenever it first came out. I think Apache is perhaps one of the best software products ever written, and frankly I found IIS to be annoyingly helpful (thereby obscuring much of what was often important). But I was looking at the problem as an engineer who had to deal with the differences, not as an IS department who had selected a technology to use.

Yes, IIS is very, very different from Apache. It does most of the same things, but you'll have to completely change your mindset. Linux/Apache/PHP is a whole different world than Windows/IIS/ASP or .net.

By now, IIS is a perfectly capable web server. Most on this forum would probably say Apache is better (and would be right), but I doubt you'll find any reasons that are compelling enough for a company that has standardized on IIS and Windows to switch. And if your company is using any of the MS technologies, or if someone else has to administer the server, they will be much happier with IIS.

Sorry to disappoint by not responding with the normal MS/Windows/IIS flame response from a Unix guy (I am a Unix guy), but business needs trump any technical advantages for the majority of applications, IMHO.

Xavier

9:35 am on Dec 19, 2004 (gmt 0)



There's not that much difference if you're still using PHP. Because the only work you'll be doing will be the same thing as before (editing source files). I think you would find it just as simple with either webserver, seeing how they are both the most popular webservers in the world.

Storyman

12:10 am on Dec 20, 2004 (gmt 0)

10+ Year Member



Thanks guys for the feedback.

The site is due for a major overall. Since the site is due for a complete overall, I've been thinking about creating an alternate site with a nonsense domain name and changing the DNS for the real domain name to point to the new site once the site is up and running.

I've already discussed the possibility of using Apache with the hosting service and they have both IIS and Apache servers. In fact their preference is for Apache.

What I'm trying to avoid is setting myself up for possibly stumbling into a bear trap.

skyeflye

3:32 am on Dec 20, 2004 (gmt 0)

10+ Year Member



In my experience, IIS tends to cost a bit more in the long run and have less out of the box functionality for average web serving.

My information may be out of date now that .NET is the standard, but back when there was only ASP 3.0, if you wanted to do anything resembling Apache's mod_rewrite functionality in IIS you pretty much had to buy a third party tool (a hundred or so bucks) and install it into IIS. This means that you need the ability to install software on the server which usually either requires in-house hosting or a dedicated hosting solution.

Performance-wise, with PHP, there really is no measurable difference under most circumstances. I have created an IIS/PHP-based site that seems to serve pages and files *incredibly* fast. I also have a Sun-Solaris/PHP website load balanced across three $1-million servers running much simpler PHP code that does not seem as fast to end users. But it probably has over a thousand times the number of simultaneous users so...

I think that perceived speed is usually impacted much, much more by other factors such as the server's actual network bandwidth at the "weakest link" in the chain, the server's processor and memory bandwidth, speed of hard disk reads and writes, number of simultaneous requests, etc. All of those things (especially the last one) tend to outweigh any speed differences between the same code executing on PHP/IIS or PHP/Apache. I'm sure there are some exceptions under unique circumstances, but I have never found any.

My 2 cents are that unless you need .NET functionality for some specialized application, such as integrating a web application with other Microsoft products, then Apache is the world's best web server.

Storyman

4:15 am on Dec 20, 2004 (gmt 0)

10+ Year Member



skyeflye,

Your info is quite helpful.

I've seen the expression 'load balancing' as part of increasing speed. Most of the references I've seen have been in reference to using SSI. Does 'load balancing' with SSI make any difference? Should I be concerned about 'load balancing?'

skyeflye

4:59 am on Dec 20, 2004 (gmt 0)

10+ Year Member



Load balancing is done by way of duplicating a web site across 2 or more web servers. Then, all incoming requests from end users are "handled" by a "load-balancer" which acts as a sort of proxy by directing end-user requests to the "least occupied" web server in the server farm.

The load balancer can be software that is running on a load-balancing server (like a normal server/computer), or it can be a specialized piece of hardware with pre-installed software from a vendor such as Cisco, Sun, etc.

That's about as much as I know about them.

You need not worry about using a load balancing solution unless your single server is getting too bogged down trying to handle all the requests that are coming into it. The kinds of issues that load balancing addresses have to do mostly with processor and memory limitations. A load balanced setup can also streamline maintenance tasks because you can potentially take one of the servers off-line to perform server software updates, reboot, etc. while the other web server(s) continue to handle all the web traffic. Simply put, you can just tell the load balancer not to send any requests to "server#1" and then you can do whatever needs to be done to server#1, unbeknownst to end users.

The complications with having more than one web server are not to be underestimated though. There need to be policies in place for assuring that all instances of the web site are absolutely identical. Also, having multiple instances of the website almost always requires the use of a dedicated database server that is a separate machine from your web servers. That way, there is only one instance of your database being used by all the website instances. The problems with having multiple database instances are pretty obvious.

SSI means using a "server-side include". It basically just means you are slurping the code of one file into another file at "runtime" (when a file is requested). It doesn't really have anything to do with load balancing.

There are multiple ways to do server-side includes. One of the easiest is with the PHP "include" handler. For example, if you had a file in your website named "foo.php", and inside that file you had the following PHP code:


<?php include("bar.php");?>

...when a user requests "foo.html" the code inside "bar.php" will get slurped into "foo.php" exactly where the "include()" statement appeared. This has practical applications for storing commonly used code snippets (such as HTML page headers and footers) in separate files, so you can edit those files and every page that "includes" them will simultaneously be updated as well. The basic concept of SSI's is both very simple and very powerful.

...hope that helps.

Storyman

5:43 am on Dec 20, 2004 (gmt 0)

10+ Year Member



skyeflye,

Your explanation of load balancing was helpful.

I've been using SSI with Apache, but have been wondering about the references I've seen about setting up .htaccess for SSI. I'm familiar with using .htaccess for mod_rewrite and the like, but have wondered why .htaccess has to be set up for SSI. What I think the purpose is so SSI can be on HTML pages that are not normally set up for dynamic coding--like PHP. Or is it something else?

skyeflye

6:07 am on Dec 20, 2004 (gmt 0)

10+ Year Member



I think that when people talk about setting up .htaccess for SSI, they probably mean turning on (or off) Apache's ability to handle SSI statements.

Normally turning on or off Apache's ability to parse SSI statements is done in the http.conf file, or in a virtualhost directive.

But as you know, using a .htaccess file allows you to override whatever setting is made in the httpd.conf file.

I think that's all people are talking about in reference to SSI's and the .htaccess file.