View Full Version : IIS 7 refuses to include files
03-25-2010, 04:37 AM
Though I have been dealing with Linux servers for over a decade, now I struggle with a simple configuration problem with an IIS server. Briefly a client's site needed some major overhaul. I have IIS 7 installed in one of the Laptops which runs Vista Business version. I copied the entire directory to the laptop. The pages are not parsed by the server and the "include file=..." statements appear as they are.
I spent some time enabling the SSI and mapping the *.htm files to the SSI handler. Still no joy. The server sits there churning out page after page without including the files it was supposed to.
I noticed another thing - information on doing the basic things with this IIS version is hard to come by.
What is that I miss ?
Thanks for being with me,
How are you accessing the page that contains the include? What is the URL you are using, and are you accessing it from the local machine or a remote machine?
03-26-2010, 01:20 AM
I access the page normally like so:
I can see the request in the log file the server generates.
Did you modify the ISS installation to allow SSI? IIS 7 requires the installation of an additional component to enable SSI, under Windows Features > Internet Information Services > World Wide Web Services > Server-Side Includes. From what I understand, even if you enable SSI through the Console, if this is not checked in Windows Features SSI won't work.
Also, since the file has a .htm extension, if you rename the file to a .shtml extension, does it work then?
03-26-2010, 10:52 PM
As far as I know, IIS 7 does not even displays static content by default. To display it, you need to enable a component "Static content" from Add/Remove features.
Since this is not your production machine, I would recommend enabling all available components to make it work.
03-27-2010, 04:02 AM
Thanks Wige and usmanz. Yes. I have enabled all components at the first time itself.
SSI requires ServerSideIncludeModule and that has been installed as wige pointed out. Every issue was checked and all appear to be set but the server doesn't parse the file. I changed the file extension to .asp which results in the dreaded internal server error (500).
Unlike Apache, IIS doesn't seem to have well publicized location where it stores the server error log files. I hunted it down here: Windows - > System32 -> Logfiles -> HTTPERR
It doesn't say much either. As usual it is cryptic - Timer_ConnectionIdle
It seems to have as much dislike towards me as I am towards it.
It transpired that the error Timer_connectionIdle has nothing to do with my problem. I solved the server error - after much head scratching and with lots of coffee. The site works fine if the files are renamed as *.asp