# Running .asp scripts using IIS



## JiminSA (Dec 15, 2011)

Is anyone familiar with how to run .asp programs/scripts from my hard drive? I was informed at this link that I should create a folder inside C:\Inetpub\wwwroot and save my asp files I wish to run, there.
Well I did this and then tried (as per the link) to run it in my browser as


> http://localhost/ClassAds/default.asp


 which gives me a 404 Error...
This hasn't surprised me, because I am running xampp and use the localhost url to run xampp htdocs and I think that maybe there is a conflict of interest between xampp and IIS.
But frankly I am at a loss


----------



## WendyM (Jun 28, 2003)

You have to enable active server pages in IIS. You don't say what version of IIS you're using, but here are the instructions for IIS 6. Hope that helps.


----------



## JiminSA (Dec 15, 2011)

Thanks for your input WendyM. I am using IIS 7 - Ah, I found out here that I have to install classic asp via Control Panel/Programs/Windows Features/Internet Information Services/Www services/Application Development Features/ASP, which I did, but I'm still not able to run asp locally...


----------



## WendyM (Jun 28, 2003)

Are xampp and IIS using the same port?


----------



## JiminSA (Dec 15, 2011)

How would I determine that? (this is a new area for me...)


----------



## JiminSA (Dec 15, 2011)

The directory paths are completely different of course...
c://xampp/htdocs/------------------------>xampp
c://inetpub/wwwroot/--------------------->asp
but ports in this context is new to me...


----------



## WendyM (Jun 28, 2003)

For xampp, if it's running, stop the service and then open [XAMPP Installation Folder]/apache/conf/httpd.conf. Search for "Listen" and the port name should come afterward (likely either 80 or 8080).

In IIS, right-click your site and select Edit Bindings. It should show you the port you're using (again, likely 80).


----------



## JiminSA (Dec 15, 2011)

I followed the procedure for xampp and yes the port is 80...
With IIS things don't seem that straightforward... I got hold of this forum link which shows how to find the port using this command - int port = Request.Url.Port;
how and where would I use this command to discover the port (which I read, defaults to 80, anyway)?

Thank you for your patience with my ignorance...


----------



## JiminSA (Dec 15, 2011)

Aha! I managed to find the IIS manager via the control panel, administrative tools and discovered that the port is 80. When I attempt to start the site it comes back with an error msg (attached)...
So I went in and changed the binding - port = 8080 - It then started ok, but when I attempted to run it in my browser I still get the 404 - I am using this URL... http://localhost/ClassAds/default.asp:confused:
So I changed it to http://localhost:8080/ClassAds/default.asp and now I get through to the IIS 7.5 - which is progress at least! But the page tells me


> HTTP Error 404.0 - Not Found
> The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.


So I went to the web.config file and changed Default.asp to default.asp and now I get


> HTTP Error 401.3 - Unauthorized
> You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.


Now where do I change directory permissions??


----------



## JiminSA (Dec 15, 2011)

This is truly frustrating
I have granted full permissions to my user account using IIS Manager and still get the 401.3 error. I have enquired at the relevant microsoft forum and they sent me this link which I have read and followed, setting everything to full permission, but still I am denied access.
I will go over this page again just to make absolutely sure


----------



## WendyM (Jun 28, 2003)

Did you enable the Anonymous Authentication and apply it to the application pool?


----------



## JiminSA (Dec 15, 2011)

No I gave permissions to User "Jim" - my sign on, but I shall try anonymous and report back...


----------

