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 execut开发者_Go百科able 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?
Go into Web Server Extensions folder under IIS manager and make sure you have allowed asp.net 2.0 apps to run
Your IUSR account needs read/write permissions on the directory you created.
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.
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
open iis. then select application pool in the left pane .select the specified site in the pool.right click and open advanced setting and then change the .NET version as required
精彩评论