Nginx+Mongrel
1.Download Nginx
You can download Nginx in this url( http://nginx.net/) .
The last stable version is nginx-0.5.34
The last development version is nginx-0.6.21
I use nginx-0.5.34
2.Setup Mongrel
gem install mongrel
gem install mongrel_cluster
3.Setup nginx-0.5.34
setup nginx need PCRE first
[root@localhost root]# ftp ftp.csx.cam.ac.uk
Name (ftp.csx.cam.ac.uk:root): anonymous
Password:
ftp> cd pub/software/programming/pcre
ftp> get pcre-7.4.tar.bz2
ftp>quit
[root@localhost root]# tar -jxvf pcre-7.4.tar.bz2
[root@localhost root]# cd pcre-7.4
[root@localhost pcre-7.4]# ./configure
[root@localhost pcre-7.4]# make
[root@localhost pcre-7.4]# wget http://sysoev.ru/nginx/nginx-0.5.34.tar.gz
[root@localhost pcre-7.4]#tar -zxvf nginx-0.5.34.tar.gz
[root@localhost pcre-7.4]#cd nginx-0.5.34
[root@localhost nginx-0.5.34]#./configure –with-pcre=/usr/local/nginx
[root@localhost nginx-0.5.34]#make && make install
4. Configure nginx
edit /usr/local/nginx/conf/nginx.conf:
5.Start nginx
[root@localhost root]#sudo /usr/local/nginx/sbin/nginx
6.Configure and Start mongrel_cluster
[root@localhost root]#cd /home/your/app/path
[root@localhost root]#sudo mongrel_rails cluster::configure -e development -p 3000 -N 4 -c /home/your/app/path -a 127.0.0.1
[root@localhost root]#sudo mongrel_rails cluster::start