2010年6月12日 星期六

The difference between IIS 5.0 and IIS 5.1

As I have mentioned in the previous blog article, I've set up a web application for handling nearly one millions of pdf files and web pages. Here's come the second part of the story:


In the company that I am working for has a remote office in mainland China. Currently, most of the server grade computers have been used for different purposes and there is no spare server by now. I search from my company's current network diagram and finally I located a Windows 2000 server which have been used for handling some domains. I can use this server to hold the mention web application.


As some of you may be quite familiar that the Internet Information Server (IIS) used in Windows 2000 cannot be upgrade to any other version. It should be IIS 5.0 (i.e. the version number is 5.0).


After I have focus the Windows 2000 server, I started add a new virtual host to the Windows 2000 server. And then, I map the extension of .htm to be handle with asp.dll for testing. And I change the current HTTP 400 File Not Found Handler to an url located in /404.asp.


Then, we started our configuration testing. We had typed an url that wasn't exist in the web server, for instance, test.pdf. The web browser received the content generated from the 404.asp file which conformed to our expectation. However, when we typed another url, say test.htm, the web browser instead of receving the expected content generated from the 404.asp file, it received firstly an HTTP 302 direction to http://www.example.com/404.asp?404,http://www.example.com/test.htm. Which is out of our expectation.

We suspected the phenomenon is come from some special feature of Internet Information Server IIS 5.0. In order to find out more information, we did a comprehensive google search. However, none of the articles have described this phenomenon, until I found an old article mentioning the IIS 4.0 telling similar situation. We confirmed this behavior by setting up another Windows 2000 server.

In our point of view, we tried to avoid the HTTP 302 because, most of the client software specific for the website don't have the functionality for handling HTTP 302 redirect. However, in the time of writing this article, we don't have a spare machine installed with a Windows 2003 server.

To cope with this problem, I have chosen another PC which has been installed with Windows XP Professional. As you may know that, Windows XP Professional only provide 10 consecutive connection and should not be used as a profession web application server.

I installed Lighttd which is one of my favorite web servers into the Windows XP Professional together with PHP 5. Then I started writing a reverse proxy server which listen to port 80 and feed the request to IIS which was listening to port 8080.

I kept all the code in ASP because I didn't want to rewrite everything.

After, I've finished the code of reverse proxy server which is using PHP running under Lighttpd. I started my beta test to see if these combination would work.

It was a good news and at the same time a bad news. The IIS 5.1 which show a quite different behavior from IIS5.0. There were no more HTTP 302 redirection for handling dynamic pages. That means I don't need the reverse proxy any more under IIS 5.1.

In this case, IIS 5.1 is working exactly the same as IIS 6.0.

So, I learned a lesson this time that never trust the version numbers.

Happy Programming,
Cloudgen

沒有留言:

張貼留言