单2.11 nginx的或Apache [英] Mono 2.11 with nginx or apache

查看:204
本文介绍了单2.11 nginx的或Apache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了并行单(2.11.3)以下说明:的 http://www.integratedwebsystems.com/2012/04/install-mono-2-11/ 现在我想就这个单实例上运行我的ASP.NET网站。我创建了使用Internet站点模板,在VS 2010中一个空MVC 4个网站,并将其发布到运行单在Linux中。

I have installed parallel Mono (2.11.3) following these instructions: http://www.integratedwebsystems.com/2012/04/install-mono-2-11/ Now I want to run my ASP.NET site on this Mono instance. I have created an empty MVC 4 site using the "Internet site" template in VS 2010 and published it to the Linux box running Mono.

我已经成功地通过以下说明(的 http://www.integratedwebsystems.com/2011/06/get-mvc3-razor-running-on-mono/ )成立之前运行xsp4环境变量。它的工作原理没有重大的问题(我看到了一些新的功能,如CSS捆绑,不工作,但以后我会处理它)。

I have succeeded in running it via xsp4 following these instructions ( http://www.integratedwebsystems.com/2011/06/get-mvc3-razor-running-on-mono/) to set up the environment variables prior to running xsp4. It works without major problems (I see that some new features, like CSS bundling, do not work, but I will deal with it later).

现在,我想用生产服务器,如Apache或nginx的。然而,似乎几乎是不可能的,似乎我不是唯一一个有这个问题。例如,使用这种简单的nginx构造

Now, I would like to use the production server like apache or nginx. However, it seems almost impossible, and it seems that I'm not the only one with this problem. For example, using this simple nginx configuration

server
{
    listen 80;
    server_name mvctest.mono;

    access_log /var/www/mvctest/log/access.log;
    error_log /var/www/mvctest/log/error.log debug;

    location /
    {
             root /var/www/mvctest/;
             index index.html index.htm default.aspx Default.aspx;
             fastcgi_index /Home;
             fastcgi_pass 127.0.0.1:9000;
             include /etc/nginx/fastcgi_params;
    }
}

在502网关错误,并且日志文件结果写着上游发送了意外的FastCGI记录:3,同时从上游读取响应头。至于为Apache + mod_mono_server4,我根本就没有移动过去的错误

results in 502 Bad Gateway error, and the log file says "upstream sent unexpected FastCGI record: 3 while reading response header from upstream". As for the Apache + mod_mono_server4, I have not moved past the error

Exception caught during reading the configuration file:
System.MissingMethodException: Method not found:     'System.Configuration.IConfigurationSectionHandler.Create'.
at     System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0 
at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 
at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0 
at Mono.WebServer.Apache.Server.get_AppSettings () [0x00001] in /opt/mono-2.11/build/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208 
at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x0002a] in /opt/mono-2.11/build/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63 

有很多帖子对这个话题,即使在这里,在#1,但没有真正的答案。但是,有些用户报告说,他们成功地在单声道与这些服务器上运行MVC4网站,所以我想知道是否有人愿意分享他们的配置设置,或一步一步的指示?

There are a lot of posts on this topic, even here on the Stackoverflow, but no real answers. However, some users do report that they succeeded in running MVC4 sites on mono with these servers, so I was wondering if anybody would like to share their configuration settings or step-by-step instructions?

推荐答案

安装包放置一些文件在错误的地方。对于Apache,你必须在文件MOD-单server4.exe从/usr/lib/mono/4.0移动到/usr/lib/mono/4.5和更新文件中引用的/ usr / bin中/ MOD-单服务器4。

The install package is placing some files in the wrong place. For Apache, you'll have to move the file mod-mono-server4.exe from /usr/lib/mono/4.0 to /usr/lib/mono/4.5 and update the reference inside the file /usr/bin/mod-mono-server4.

如果您正在使用XSP或FastCGI的,将需要xsp4.exe和FastCGI,单server4.exe和在/ usr / bin中各自引用同样的待遇。

If you were using XSP or FastCgi, the same treatment would be required for xsp4.exe and fastcgi-mono-server4.exe and their respective references in /usr/bin.

(我开始后悔我跟着沿着这条道路黑白...)

(I am starting to regret I followed down this Mono path... )

这篇关于单2.11 nginx的或Apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆