问题描述
我正在尝试在运行 iis7 的服务器上部署我在 mvc3 中构建的网站.我能够让它在我的笔记本电脑上本地通过 iis7 运行,但是当我尝试将它放在服务器上时,我在尝试远程访问它时收到 403 access denied 错误,当我尝试时出现连接超时"从服务器本身查看它.
I am trying to deploy a website that I have built in mvc3 on an server that runs iis7. I was able to get it running through the iis7 locally on my laptop, but when I try to put it on the server I get a 403 access denied error when trying to get to it remotely and a "connection has timed out" when I try to view it from the server itself.
我已确保我拥有使用 asp_regiis.exe 的最新 .Net 4 框架.我尝试了多个应用程序池,包括默认值.我允许 .net4 isapi.我已更改权限以允许来自 IUSER、SERVER NETWORK、Authenticated Users 的访问.我已确保默认文档列表与我的笔记本电脑 iis7 上的相同(工作正常).
I have made sure I have the most recent .Net 4 framework using the asp_regiis.exe. I tried multiple application pools including the default. I allowed .net4 isapi. I have changed permission to allow access from IUSER, SERVER NETWORK, Authenticated Users. I have made sure the default document list is the same as the one on my laptop iis7 (which works fine).
我还有多个其他网站(使用 webforms,而不是 mvc)在服务器上运行良好.
I also have multiple other sites (using webforms, not mvc) working just fine on the server.
这可能与我将文件传递到服务器的方式有关吗?我只是将文件压缩并将它们(并解压缩)放在服务器上,并将 iis 定向到创建的目录.
Could it have something to do with the way I passed to files to the server? I just zipped the files up and placed them (and unzipped them) on the server and directed iis to the created directory.
我错过了什么?
推荐答案
我上周遇到了这个错误,可能是由很多原因引起的:
I faced this error last week and it can be caused by many things:
- 未安装正确版本的 .NET 框架或未在 asp_regiis.exe 中注册
- runAllManagedModulesForAllRequests"在您的 web.config 中设置为 false
- 服务器中没有安装正确版本的MVC
- 你有一个忽略你的请求的忽略路由
- 您的 Application_Start 出现早期异常,您的网站无法正常启动
就我而言,我忘记将 web.config 中的日志记录目录路径值更改为现有目录.
For my part I forget to changed my logging directory path value in the web.config to an existing directoy.
要知道这是配置错误还是应用程序错误,您可以做的是在 VS 中创建一个新的默认 MVC 项目并将其部署在同一个应用程序池中.
What you can do to know if it's an configuration error or an error in your application is to create a new default MVC project in VS and to deploy it in the same apppool.
这篇关于IIS7 403 - 拒绝访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!