gpt4 book ai didi

linux - 使用 mono 在 Centos 中部署 ASP.net

转载 作者:太空宇宙 更新时间:2023-11-04 09:22:00 25 4
gpt4 key购买 nike

我想部署一个构建在 ASPnet 4.0 框架应用程序中的解决方案,开发是在 WindowsSO/IIS 中完成的。

现在我需要部署在操作系统 Centos 上,用作 NginX Web 服务器。

我正在使用 Centos-6.8、Nginx-1.10 和 mono-4.6.1.5。

我的 nginx 配置文件是:

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
#root /usr/share/nginx/html/Site;

location / {
index index.aspx index.html index.htm index.aspx default.aspx Default.aspx Global.asax;
fastcgi_index Global.asax;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
...
}

文件 fastcgi_params 我包括:

fastcgi_param  PATH_INFO          "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

启动单声道服务

fastcgi-mono-server4 /applications=/:/usr/share/nginx/html /socket=tcp:127.0.0.1:9000 &

我访问 http://localhost/Default.aspx用于测试,如果显示结果。

问题是在访问站点文件夹时 http://localhost/Site/ , 显示以下消息:

System.Web.HttpException
This type of page is not served.

Description: HTTP 403.The type of page you have requested is not served because it has been explicitly forbidden. The extension '.asax' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Details: Requested URL: /Site/Global.asax
Exception stack trace:
at System.Web.HttpForbiddenHandler.ProcessRequest (System.Web.HttpContext context) [0x00073] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00dd7] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.HttpApplication.Tick () [0x00000] in <d3ba84a338d241e2ab5397407351c9cd>:0

nginx 用户对 Site 文件夹具有权限,可能在应用程序的 Web.Config 中缺少一些依赖项,有什么想法吗?谢谢。

最佳答案

听起来好像存在权限问题。请检查并确保网站的权限为 755。如果不是,请“sudo chmod -R 755”文件夹。

一些进一步的阅读。

https://askubuntu.com/questions/9402/what-file-permissions-should-i-set-on-web-root

关于linux - 使用 mono 在 Centos 中部署 ASP.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40768622/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com