这是我的/etc/nginx/sites-available/default
:
# Sample site
server {
listen 80; ## listen for ipv4
server_name web;
access_log /var/log/nginx/web.access.log;
location / {
root /srv/www/web/;
index default.cshtml Default.cshtml;
fastcgi_index Default.cshtml;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
}
# Another Sample site
server {
listen 80; ## listen for ipv4
server_name irws;
access_log /var/log/nginx/irws.access.log;
location / {
root /srv/www/irws/;
index default.cshtml Default.cshtml;
fastcgi_index Default.cshtml;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
}
这是我的脚本开始fastcgi-mono-server4
:
export MONO_IOMAP=all
fastcgi-mono-server4 /address=127.0.0.1 /applications=irws:/:/srv/www/irws/,web:/:/var/www/web/ /socket=tcp:9000 &
我不明白为什么只有/applications
参数中定义的第一个应用程序有效。在这种情况下,只http://irws/
起作用,但http://web/
不起作用。如果我将它们切换为:
fastcgi-mono-server4 /address=127.0.0.1 /applications=web:/:/srv/www/web/,irws:/:/var/www/irws/ /socket=tcp:9000 &
然后只http://web/
工作并http://irws
停止工作。我想我在这里遗漏了一些非常简单的东西。
我收到的错误消息如下所示:
Directory does not exists Parameter name: value
Description: HTTP 400. Error processing request.
Stack Trace:
System.ArgumentException: Directory does not exists
Parameter name: value
at System.IO.FileSystemWatcher.set_Path (System.String value) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.FileSystemWatcher:set_Path (string)
at System.Web.HttpRuntime.SetupOfflineWatch () [0x00000] in <filename unknown>:0
at System.Web.HttpRuntime.Process (System.Web.HttpWorkerRequest req) [0x00000] in <filename unknown>:0
at System.Web.HttpRuntime.RealProcessRequest (System.Object o) [0x00000] in <filename unknown>:0
at System.Web.HttpRuntime.ProcessRequest (System.Web.HttpWorkerRequest wr) [0x00000] in <filename unknown>:0
at Mono.WebServer.MonoWorkerRequest.ProcessRequest () [0x00000] in <filename unknown>:0
知道我在这里可能会遗漏什么吗?
该
--applications
参数指定同一虚拟主机内的路径。您可能需要编写一个webapp 文件并使用--appconfigfile
参数指定它,以便为多个虚拟主机提供服务。