Mono+Nginx环境

首先创建www用户和组,

虚拟主机使用的目录:

/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
mkdir -p /data0/htdocs/www
chmod +w /data0/htdocs/www
chown -R www:www /data0/htdocs/www

安装Momo

yum groupinstall "Development Tools"

yum install httpd build-essential gcc bzip bison pkgconfig glib-devel glib2-devel httpd-devel libpng-devel libX11-devel freetype fontconfig pango-devel ruby ruby-rdoc gtkhtml38-devel wget

wget http://pkgs.fedoraproject.org/repo/pkgs/mono/mono-2.6.1.tar.bz2/4cd2157c9eabbe9f49232d5ee3a2a57e/mono-2.6.1.tar.bz2

tar jxvf mono-2.6.1.tar.bz2

cd mono-2.6.1/

./configure --prefix=/usr

make

make install

cd ../

SVN版本库安装fastcgi-momo-server

export PKG_CONFIG_PATH=/usr/lib/pkgconfig/:/usr/lib/

yum install subversion

svn co http://mono-soc-2007.googlecode.com/svn/trunk/brian/FastCgi/ fastcgi-mono-server

cd fastcgi-mono-server/

./autogen.sh

make

make install

cd ../

Fastcgi方式启动fastcgi-momo-server2,监听本机9001端口,网页根目录为/data0/htdocs/www/

nohup /bin/sh /usr/local/bin/fastcgi-mono-server2 /socket=tcp:9001 /root=/data0/htdocs/www/ 2>&1 > /dev/null &

安装Nginx 0.8.46
1
、安装Nginx所需的pcre库:

wget http://ftp.exim.llorien.org/pcre/pcre-8.12.tar.gz

tar zxvf pcre-8.12.tar.gz
cd pcre-8.12/
./configure
make && make install
cd ../

2、安装Nginx

wget http://nginx.org/download/nginx-0.8.46.tar.gz

tar zxvf nginx-0.8.46.tar.gz
cd nginx-0.8.46/
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install
cd ../
3
、创建Nginx日志目录

mkdir -p /data1/logs
chmod +w /data1/logs
chown -R www:www /data1/logs
4
、创建Nginx配置文件

、在/usr/local/webserver/nginx/conf/目录中创建nginx.conf文件:

rm -f /usr/local/webserver/nginx/conf/nginx.conf
vi /usr/local/webserver/nginx/conf/nginx.conf

修改nginx.conf

user  www www;

worker_processes 8;

error_log  /usr/local/webserver/nginx/logs/nginx_error.log  crit;

pid        /usr/local/webserver/nginx/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.

worker_rlimit_nofile 65535;

events

{

use epoll;

worker_connections 65535;

}

http

{

include       mime.types;

default_type  application/octet-stream;

charset  utf-8;

server_names_hash_bucket_size 128;

client_header_buffer_size 32k;

large_client_header_buffers 4 32k;

client_max_body_size 8m;

sendfile on;

tcp_nopush     on;

keepalive_timeout 60;

tcp_nodelay on;


fastcgi_connect_timeout 300;

fastcgi_send_timeout 300;

fastcgi_read_timeout 300;

fastcgi_buffer_size 64k;

fastcgi_buffers 4 64k;

fastcgi_busy_buffers_size 128k;

fastcgi_temp_file_write_size 128k;


gzip on;

gzip_min_length  1k;

gzip_buffers     4 16k;

gzip_http_version 1.1;

gzip_comp_level 2;

gzip_types      text/plain application/x-javascript text/css application/xml;

gzip_vary on;


server

{

listen       80;

server_name  www.yourdomain.com;

index index.html index.htm index.aspx default.aspx;

root  /data0/htdocs/www;


location ~ \.(aspx|asmx|ashx|asax|ascx|soap|rem|axd|cs|config|dll)?$ {

fastcgi_pass   127.0.0.1:9001;

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

include        fastcgi_params;

}


location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

{

expires      30d;

}


location ~ .*\.(js|css)?$

{

expires      1h;

}


access_log  off;

}

}

测试配置文件是否正确

/usr/local/webserver/nginx/sbin/nginx -t

/data0/htdocs/www/目录下载名为info.aspxasp探针文件。检查asp.net是否能正常运行

cd /data0/htdocs/www/

wget http://aspnetsysinfo.googlecode.com/files/aspnetsysinfo-revision_23.zip

浏览器测试

http://IP/info.aspx


转载于:https://my.oschina.net/HeAlvin/blog/370762

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值