403 -禁止:访问被拒绝。ASP。净MVC(复制)

时间:2022-08-07 00:16:38

Possible Duplicate:
ASP MVC in IIS 7 results in: HTTP Error 403.14 - Forbidden

可能的重复:IIS 7中的ASP MVC导致:HTTP错误403.14 -禁止。

I published my application on server. When I enter my domain i got this error:

我在服务器上发布了我的应用程序。当我进入我的域名时,我得到了这个错误:

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

403 -禁止:访问被拒绝。您没有权限使用所提供的凭据来查看此目录或页面。

What's happend?

发生什么?

4 个解决方案

#1


11  

Are you hosting the site on iis? if so make sure the account your website runs under has access to local file system?

您是否在iis上托管站点?如果有,确保你的网站运行的帐户有访问本地文件系统的权限?

Straight from msdn .....

直接从msdn .....

The Network Service account has Read and Execute permissions on the IIS server root folder by default. The IIS server root folder is named Wwwroot. 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.

默认情况下,网络服务帐户已读取和执行IIS服务器根文件夹的权限。IIS服务器根文件夹被命名为Wwwroot。这意味着一个ASP。部署在根文件夹中的NET应用程序已经具有对其应用程序文件夹的读和执行权限。然而,如果你的ASP。NET应用程序需要在其他位置使用文件或文件夹,您必须特别启用访问。

To provide access to an ASP.NET application running as Network Service, you must grant access to the Network Service account.

提供对ASP的访问。NET应用程序作为网络服务运行,您必须授予对网络服务帐户的访问权。

To grant read, write, and modify permissions to a specific file

授予对特定文件的读、写和修改权限

  • In Windows Explorer, locate and select the required file.
  • 在Windows资源管理器中,找到并选择所需的文件。
  • Right-click the file, and then click Properties.
  • 右键单击文件,然后单击Properties。
  • In the Properties dialog box, click the Security tab.
  • 在“属性”对话框中,单击“安全性”选项卡。
  • On the Security tab, examine the list of users. If the Network Service
  • 在Security选项卡上,检查用户列表。如果网络服务
  • account is not listed, add it.
  • 帐号未列出,请添加。
  • In the Properties dialog box, click the Network Service user name, and in the Permissions for NETWORK SERVICE section, select the Read, Write, and Modify permissions.
  • 在“属性”对话框中,单击“网络服务用户名”,在“网络服务权限”一节中,选择“读、写和修改权限”。
  • Click Apply, and then click OK.
  • 单击Apply,然后单击OK。

Click here for more

点击这里获取更多

#2


11  

In addition to the answers above, you may also get that error when you have Windows Authenticaton set and :

除了上面的答案之外,如果您有Windows Authenticaton设置,并且:

  • IIS is pointing to an empty folder.
  • IIS指向一个空文件夹。
  • You do not have a default document set.
  • 您没有默认的文档集。

#3


8  

I just had this issue, it was because the IIS site was pointing at the wrong Application Pool.

我刚遇到这个问题,是因为IIS站点指向错误的应用程序池。

#4


3  

I had the same issue (on windows server 2003), check in the IIS console if you have allowed ASP.NET v4 service extension (under IIS / ComputerName / Web Service extensions)

我也遇到了同样的问题(在windows server 2003上),如果允许的话,请检查IIS控制台。NET v4服务扩展(在IIS / ComputerName / Web服务扩展下)

#1


11  

Are you hosting the site on iis? if so make sure the account your website runs under has access to local file system?

您是否在iis上托管站点?如果有,确保你的网站运行的帐户有访问本地文件系统的权限?

Straight from msdn .....

直接从msdn .....

The Network Service account has Read and Execute permissions on the IIS server root folder by default. The IIS server root folder is named Wwwroot. 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.

默认情况下,网络服务帐户已读取和执行IIS服务器根文件夹的权限。IIS服务器根文件夹被命名为Wwwroot。这意味着一个ASP。部署在根文件夹中的NET应用程序已经具有对其应用程序文件夹的读和执行权限。然而,如果你的ASP。NET应用程序需要在其他位置使用文件或文件夹,您必须特别启用访问。

To provide access to an ASP.NET application running as Network Service, you must grant access to the Network Service account.

提供对ASP的访问。NET应用程序作为网络服务运行,您必须授予对网络服务帐户的访问权。

To grant read, write, and modify permissions to a specific file

授予对特定文件的读、写和修改权限

  • In Windows Explorer, locate and select the required file.
  • 在Windows资源管理器中,找到并选择所需的文件。
  • Right-click the file, and then click Properties.
  • 右键单击文件,然后单击Properties。
  • In the Properties dialog box, click the Security tab.
  • 在“属性”对话框中,单击“安全性”选项卡。
  • On the Security tab, examine the list of users. If the Network Service
  • 在Security选项卡上,检查用户列表。如果网络服务
  • account is not listed, add it.
  • 帐号未列出,请添加。
  • In the Properties dialog box, click the Network Service user name, and in the Permissions for NETWORK SERVICE section, select the Read, Write, and Modify permissions.
  • 在“属性”对话框中,单击“网络服务用户名”,在“网络服务权限”一节中,选择“读、写和修改权限”。
  • Click Apply, and then click OK.
  • 单击Apply,然后单击OK。

Click here for more

点击这里获取更多

#2


11  

In addition to the answers above, you may also get that error when you have Windows Authenticaton set and :

除了上面的答案之外,如果您有Windows Authenticaton设置,并且:

  • IIS is pointing to an empty folder.
  • IIS指向一个空文件夹。
  • You do not have a default document set.
  • 您没有默认的文档集。

#3


8  

I just had this issue, it was because the IIS site was pointing at the wrong Application Pool.

我刚遇到这个问题,是因为IIS站点指向错误的应用程序池。

#4


3  

I had the same issue (on windows server 2003), check in the IIS console if you have allowed ASP.NET v4 service extension (under IIS / ComputerName / Web Service extensions)

我也遇到了同样的问题(在windows server 2003上),如果允许的话,请检查IIS控制台。NET v4服务扩展(在IIS / ComputerName / Web服务扩展下)