tags:

views:

182

answers:

4

Hi, I've created several IIS websites in my life, but some days ago a friend of mine asked me to host his website, so I created a folder within inetpub/wwwroot to store it.

Then, I created a virtual directory in my Default Web Site(the folder appears there as it's on wwwroot) and created the application, and allowed scripts & executables permissions. Also, I've set up the proper document types the website will have(default.aspx, asp, etc) and the folder has all the permissions i usually grant: iusr, iwmp, asp.net, network, etc.

When I reset IIS services and then look at the website(I've added the headers too) I get the following error:

You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.

I've been searching for a while on internet and the only thing I found is to allow Executables to my website, which I've already done.

But, when I deleted the asp.net pages and I only add an html file, it will display on the browser.

Does anyone have any clue about this?

+1  A: 

Go into Web Server Extensions folder under IIS manager and make sure you have allowed asp.net 2.0 apps to run

Andrew
Its allowed. This website is running under 3.5 framework though. Do I have to add it to the web server extensions too? In that case, which dll file do I have to add?
Brian Roisentul
+1  A: 

Your IUSR account needs read/write permissions on the directory you created.

Matt
It already has.
Brian Roisentul
@Matt - If the wrong NTFS permissions were set for the anonymous user account you'd get a popup in the browser asking for credentials.
Kev
A: 

The error you're getting definitely means that your script Execute Permissions are incorrect. In IIS Manager, go back to the folder in question and double check the setting on the Directory tab of the folder/virtual directory in question.

You should also try this with a classic ASP script (with just <% Response.Write "Hello" %> in the file) just to make sure, but I'm sure the result will be the same.

If you're still having problems, open the IIS metabase (in C:\WINDOWS\system32\inetsrv\metabase.xml) and locate the folder in question. To do this, search for (assuming that you put the site under the Default Web Site) the following string:

Location ="/LM/W3SVC/1/ROOT"

This should locate the IIsWebVirtualDir for the root of the Default Web Site. It'll look like this:

<IIsWebVirtualDir Location ="/LM/W3SVC/1/ROOT"`
  AccessFlags="AccessRead | AccessScript"
  AppFriendlyName="Default Application"
     ...other attributes...
  >
</IIsWebVirtualDir>

Scroll down a bit until you find a location path that matches the folder you put your friends website into e.g.

Location ="/LM/W3SVC/1/ROOT/JoesSite"

When you've found this, take a look at the AccessFlags attribute, it should look like:

AccessFlags="AccessRead | AccessScript"

Tell us what you see on that metabase node.

Kev
A: 

Well, as it's a website and not a web application, it seems that it didn't work as a virtual directory, but it did as a IIS website.

Thank you.

Brian

Brian Roisentul