Zope behind IIS |
Created by andym . Last modified 2004-11-22 12:19:53. |
Using Zope behind IIS |
Note: Enfold Systems now sells a full featured proxy for IIS that is designed for Plone, it features caching, compression and much more. It also removes the need to hook up 404's, which will make your logs much better. For more information see: EEP Note: This has now been much improved by Hyperlogica, take a look here: http://www.zope.org/Members/hiperlogica/ASP404. Files: error.asp Running Zope behind IIS is a pain. PCGI sucks and is single threaded, but thats the only real option people have. Most Zope solutions involve Apache and that rocks 'cos Apache is great but for consultants or people who have to use IIS there are no great solutions. One solution was proposed by David Carter-Tod here: http://www.wc.cc.va.us/dtod/zope/. Essentially you send your 404 error to an ASP script which then sends it on to Zope. I had an afternoon and to find a solution so I tried implementing his suggestion. After finding a few issues I thought I would post a how to...
Notes I made the following changes to Davids original script:
Comments from: Mike Sharp, thanks! First, this line: Set objXMLHttp = Server.CreateObject("Microsoft.XMLHTTP") ...uses wininet, the old parser API, and isn't server safe. MSXML 3.0 had the server safe XMLHTTPRequest object, but IIRC, it's only functional with the service pack. Anyway, the correct progID (version independant) is: Set objXMLHttp = Server.CreateObject("Msxml2.SERVERXMLHTTP") Using this object gives you a couple of really nice new features, too. For one thing, you can set timeouts, and there are methods for asyncronously polling for a response. You can also set and read headers. Here's an MSDN article on the new object: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/htm/xmobjxmldomserverxmlhttp.asp MSXML 4.0 of the parser has improved it even more. Also, your caching problems might be solved with this line at the beginning of error.asp: Response.Expires = -1000 Comments from: Chaitra on trying not to get I set the if-modified-since tag in the request header and gave some old date..so its always greater that the date specified..so it gets the new response...and it works fine :) pIXMLHTTPRequest->setRequestHeader("If-Modified-Since","Tue, 11 Jul 2000 18:23:51 GMT"); |