一:安装nginx
nginx安装请参考:http://qingshuis.iteye.com/admin/blogs/1959967
二:安装resin
1:选定源码目录
可以是任何目录,本文选定的是/works
cd /works
2:安装resin
wget http://www.caucho.com/download/resin-3.0.23.tar.gz
tar -vzxf resin -3.0.23.tar.gz 到你想放置的目录
cd resin-3.0.23
./configure
make
make install
3:修改端口号
端口号修改:/works/resin-3.0.23/conf/resin.conf
默认8080,可修改
4:启动resin
works/resin-3.0.23/bin/http.sh start
浏览器中输入host:端口,能打开resin欢迎界面说明resin配置成功
5:整合nginx, resin
使用nginx的proxy功能,将请求转发给resin
修改nginx的配置文件nginx.conf
程序代码
server {
listen 80;
server_name www.qinghuis.com;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
access_log on;
proxy_pass http://127.0.0.1:8082;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m;
client_body_buffer_size 128k;
}
}
修改配置后重启nginx,访问nginx则会跳转至resin欢迎页