赞0
1.安装 nginx 编译安装时注意 prec zlib 等前置nginx 包2.安装 mono centos官网没有编译好的包,需要下载源码编译,稳定版
wget http://download.mono-project.com/sources/mono/mono-2.10.6.tar.bz2
//wget http://download.mono-project.com/sources/mod_mono/mod_mono-2.10.tar.bz2(Apache fastcgi模块)
wget http://download.mono-project.com/sources/xsp/xsp-2.10.2.tar.bz2
tar –jxvf xsp-2.10.2.tar.bz2
cd xsp-2.10.2
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig (如果没有这个,在下步提示无mono库)
./configure
make
make install
压缩 tar -jcxf **.tar.bz2 解压缩tar -jxvf **.tar.bz2
稳定版 http://ftp.novell.com/pub/mono/sources-stable/
参考
http://hi.baidu.com/xc_hai/blog/item/554aa1dc7a6c5dc28c1029c7.html
http://www.haogongju.net/art/82011
http://hi.baidu.com/xc_hai/blog/item/0b36d82d65e89ff78b13995e.html
http://blog.csdn.net/lanxe/article/details/6682218
说明:centos 5.4 nginx 1.0.9 mono 2.10.6
需要安装xsp(官方小型.Net Web服务器,可以单独作为Web服务器,其中的fastcgi-mono-server2/4也可作为nginx的fastcgi方式运行) fastcgi 支持nginx(也可以安装fastcgi-mono-server:svn获取 http://mono-soc-2007.googlecode.com/svn/trunk/brian/FastCgi/,两者差别暂未知)
或者参考 http://blog.bookcold.me/2011/05/693 统一 安装mono xsp2 mono_apache
3.配置nginx.conf
server {
listen 80;
server_name 127.0.0.1;
access_log /var/log/nginx/your.domain1.xyz.access.log;
location / {
root /var/www/aspx/;
index index.html index.htm default.aspx Default.aspx;
fastcgi_index Default.aspx;
fastcgi_pass 127.0.0.1:9001;
fastcgi_param SCRIPT_FILENAME /var/www/aspx/$fastcgi_script_name;
include fastcgi_params;
}
}
4.配置fastcgi_params (如果在nginx 中配置fastcgi_param,则不再配置如上);
fastcgi_param PATH_INFO "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
5.启动fastcgi
fast-momo-server:fastcgi-mono-server4 .Net 4.0
fastcgi-mono-server2 /applications=aspx:/:/var/www/aspx/ /socket=tcp:127.0.0.1:9001 &
nohup fastcgi-mono-server4 /applications=/:/var/www/aspx/ /socket=tcp:127.0.0.1:9001 & (后台程序运行)
6.重启nginx
启动Nginx,在/var/www/aspx/目录下下载info.apsx的ASP.NET探针文件,以检查ASP.NET程序能否正常运行:
cd /var/www/aspx/
wget http://aspnetsysinfo.googlecode.com/files/aspnetsysinfo-revision_23.zip
unzip aspnetsysinfo-revision_23.zip