Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

403 forbidden after publishing asp.net MVC

I know this has been answered a few times but none of the solutions worked for me. I published my ASP.NET MVC 3 application (It was just the internet template without any changes to it) to see if I could get it to work publically. However, when I visit the site it shows up with a 403 error. Coming from a php/linux background, I'm confused and have no clue where to look. I've only been learning .NET for about 8-9 months and everything I've been testing on before was on the local development server through VS2010. It almost appears like the server doesnt know it should be an MVC application or I have to change my routing.

Anyway, I checked to make sure that the server setting is .NET 4. Any help would be greatly appreciated.

ALSO, It's a shared hosting environment using arvixe.

like image 802
Anonymous Avatar asked Jun 15 '12 00:06

Anonymous


People also ask

What is 403 forbidden And how do you fix it?

A 403 Forbidden Error occurs when you do not have permission to access a web page or something else on a web server. It's usually a problem with the website itself. However, you can try refreshing the page, clearing your cache and cookies, and disconnecting from any VPN you might be using.

Is ASP NET 403 forbidden access is denied?

This means that an ASP.NET application deployed inside the root folder already has Read and Execute permissions to its application folders. However, if your ASP.NET application needs to use files or folders in other locations, you must specifically enable access.


1 Answers

For me this did the trick (Original Answer by Mmerrell at Getting 404.0 error for ASP.NET MVC 3 app on IIS 7.0 / Windows Server 2008 )

You actually just reminded me that I needed to fix this issue in an enviroment here. If your situation is the same as mine then it's a simple fix.

Just add the following to your web config:

<system.webServer>      <modules runAllManagedModulesForAllRequests="true" />  

Make sure your have choosen the "ASP.Net 4.0" App-Pool and not the App-Pool created for your application. Make sure your App Pool uses the "ApplicationPoolIdentity" and NOT NetworkService. Remove the NetworkService permission from your root folder. You dont need it. IIS has an built-in identity (IIS_IUSRS).

like image 187
Robert Avatar answered Oct 04 '22 03:10

Robert