HTTP 403 Forbidden : This website requires you to log in

旧城冷巷雨未停 提交于 2019-12-13 00:41:58

问题


Using asp .net MVC 4.0 , razor , VS2010 , IIS5.2 , windows Server 2003

I have built an application which i want to publish in IIS. what i did is listed below:

  1. Cleaned then built the solution.
  2. right click on project file and clicked PUBLISH.
  3. publish method : File System
  4. Target Location : C:\Inetpub\wwwroot\testing
  5. then publish.

Then i went to IIS and got my site in Default web sites. happy :). Then i did:

  1. right clicked on testing(my app) and open properties.
  2. In the tabdirectory everything goes fine.
  3. in asp.nettab, i set asp .net version 4.0.30319
  4. here is a little confusion, I set home/index as my default content page in documentstab
  5. then I right click testing and clicked browse. And it shows :

Most likely causes:

This website requires you to log in.

This error(HTTP 403 Forbidden) means that this program was able to connect to the website, but it does not have permission to view the webpage.

a short summury what i got as error message. This is my fist mvc application and first hosting. What is my fault here? what should i do now?


回答1:


I had the similar issue. Please try the following:

A. Suggestion below from Microsoft Technet helped me:

The solution is to ensure that the Authenticated Users or \Users group (which usually contains DOMAIN\Users group) has Read & Execute, List Folder Contents and Read permissions on the /BIN folder below C:\inetpub\wwwroot\wss\VirtualDirectories{Sitename80}. Follow the steps listed below to grant the required permissions:

  1. Open Windows Explorer and navigate to the /bin directory of your web application

  2. Right-click on the folder and click on Properties

  3. Go to Security tab and click on Edit

  4. Click on Add and add the local server group Authenticated Users or < SERVER NAME >\Users (this usually contains DOMAIN\Users group).

  5. Select the Read & Execute, List Folder Contents and Read permissions (if you are planning to add Everyone to the /bin folder, grant Read permissions only)

  6. Click OK to apply the new settings

  7. NOTE: you may need to to it after every Publish, as permissions somehow may get reset.

B. In VS - set the default page for your website, or try navigating to specific page as opposed to simply opening the website with only the site name.

I know it sounds dumb, but that also was the problem for me

after publishing your webiste to IIS, navigate to http://myServer/mySite/somePage instead of http://myServer/MySite



来源:https://stackoverflow.com/questions/14751179/http-403-forbidden-this-website-requires-you-to-log-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!