2013-10-07 29 views
2

在一測試盒:單聲道+ MVC 4 + .NET 4.0 + nginx的404(也與XSP)

[email protected]:/var/www# mono --version 
Mono JIT compiler version 3.0.6 (Debian 3.0.6+dfsg-1~exp1~pre1) 
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com 
    TLS:   __thread 
    SIGSEGV:  altstack 
    Notifications: epoll 
    Architecture: amd64 
    Disabled:  none 
    Misc:   softdebug 
    LLVM:   supported, not enabled. 
    GC:   Included Boehm (with typed GC and Parallel Mark) 

XSP(從GitHub編譯)

[email protected]:/var/www# xsp4 --version 
Mono.WebServer2.dll 0.4.0.0 
(c) (c) 2002-2011 Novell, Inc. 
Classes for embedding an ASP.NET server in your application .NET 4.0. 

nginx的配置:

[email protected]:/var/www# cat /etc/nginx/sites-available/default 
server { 
     listen 80; 
     access_log /var/log/nginx/mono.log; 
     error_log /var/log/nginx/mono.err.log; 

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

正在運行fastcgi-mono-server4:

[email protected]:/var/www# fastcgi-mono-server4 /applications="/:/var/www/" /socket=tcp:127.0.0.1:9000 -v 
[2013-10-06 16:11:07.579396] Notice : Adding applications '/:/var/www/'... 
[2013-10-06 16:11:07.607587] Notice : Registering application: 
[2013-10-06 16:11:07.607832] Notice :  Host:   any 
[2013-10-06 16:11:07.608034] Notice :  Port:   any 
[2013-10-06 16:11:07.608230] Notice :  Virtual path:/
[2013-10-06 16:11:07.608454] Notice :  Physical path: /var/www/ 

我什麼都沒有,只有404,我已經設置了權限775只是爲了確保它不是在DLL的權限問題,沒有去。

我甚至在我的Global.asax試過這樣:

protected void Application_BeginRequest(object sender, EventArgs e) 
{ 
    throw new Exception("test"); 
} 

還只是404,而不是錯誤,所以XSP似乎都不承認有此應用程序...罰款運行在Windows上盒。我錯過了什麼嗎?我也想在Linux上開發Mono ...

+0

http://www.mono-project.com/docs/web/fastcgi/nginx/ –

回答

3

你有什麼錯誤?

也許看看Heroku的.NET buildpack如何得到這個運行:https://github.com/friism/dev-heroku-buildpack-mono/blob/master/nginx/start#L8

有幾個博客文章與細節,並自述:

您通常可以通過傳遞此參數獲得fastcgi-mono-server輸出其他調試信息:/printlog=True

+0

http:// www .philliphaydon.com/2013/06/setting-up-mono-on-nginx/ 我很掙扎,這個網站相當有幫助 – Suman