Ubuntu 12.04使用uginx+fastcgi-mono-server2部署asp.net 网站
1.安装nginx和mono-fastcgi-server2
sodu apt-get install nginx
sodu apt-get install mono-fastcgi-server2
2.配置 nginx和mono-fastcgi-server2
2.1 在终端输入sudo gedit /etc/nginx/nginx.conf
在http节点,添加以下server节点
server {
listen 80;
server_name 127.0.0.1;
location ~ {
root /home/david/demo/demo/demo/;#网站的根目录
index index.html index.htm default.aspx Default.aspx; fastcgi_index Index.aspx;
fastcgi_pass 127.0.0.1:9000; #对应mono-fastcgi-server2端口
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params;
}
}
2.2 在终端输入sudo gedit /etc/nginx/sites-available/default,将上面配置信息添加到server节点中。
2.3在终端输入sudo gedit /etc/nginx/fastcgi_params ,将以下配置信息加入最后。
fastcgi_param PATH_INFO "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
3.运行
3.1 启动nginx
sudo /etc/init.d/nginx start
3.2 启动 fastcgi-mono-server端口
sudo fastcgi-mono-server2 /socket=tcp:9000 /address=127.0.0.1 /applications=/:/home/david/demo/demo/demo/
4,最后运行效果图