xurca
xurca

Reputation: 2426

Install asp.net mvc application on windows server

I have following problem:

there is windows server 2008 r2

it has iis 7.5 installed

I moved my application there (it is asp.net mvc 5 application), installed .net 4.5 framework on the server

ran following command in cmd

but still it throws exception: 403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied.

I enabled directory browsing and only thing that it can make is browse through folders. But it is web application and not file directory to browse.

So can anyone tell me what am I missing?

IIS configuration:

enter image description here

UPDATE 1 IUSR and IIS_IUSRS both have full control I also tried adding Everyone with full control on the folder where my application is, but still same

Upvotes: 0

Views: 305

Answers (4)

PVivek
PVivek

Reputation: 21

go to published folder of your application and give edit update access to iis user to that folder then it will work, right click on folder click properties and then click on security and then full control to iis user.

Upvotes: 0

Juergen Gutsch
Juergen Gutsch

Reputation: 1764

"403 - Forbidden: Access is denied" means the IIS doesn't have the rights to access the resources in your application folder. It is usually a problem with the user the IIS uses to access the resources.

Just as a test: give "everyone" the full rights to the directory where your application is located. If this works, remove "everyone" and give the user IIS_IUSRS the rights to read the resources on the directory (maybe this user needs rights to write in the App_Data folder).

Upvotes: 0

Gelootn
Gelootn

Reputation: 601

make sure that the MVC Dll's are included in the build output of your project.

Also try adding this code to the system.webserver part of your web.config

<modules runAllManagedModulesForAllRequests="true">

https://www.iis.net/configreference/system.webserver/modules

<modules runAllManagedModulesForAllRequests="true" /> Meaning

Upvotes: 1

Arnel Aves
Arnel Aves

Reputation: 87

If you are trying to test your site by launching http://yourdomain.com/ then it will display all files like you are "Browsing the Directory", you have to add a default document - this is the your main or landing page on your web application settings. On IIS Manager, click your site, on the right pane, under IIS, click Default Document and set the page you want to show first.

Upvotes: 0

Related Questions