這篇文章很久以前寫的,找不到post到哪兒去了,再發一遍。因為oe.monweb.cn上的文章google是搜不到的(這是一個feature,叫做anti search engine )
不過申明,ase和最近的google事件沒有任何關係,只是覺得使用者可能不想讓自己的文章在發布之前被別人搜到而已。開心寫作網只是一個專業寫作工具,不是blog網站。
This is a way to run ruby on rails, since rails will never support fastcgi.
All operation is following the nice artile http://wiki.rubyonrails.org/deployment/apache-mongrel
Pre-requisites
mod_proxy and mod_rewrite enabled.
Step1 Create vhost
ServerAdmin jackie.ju@gmail.com
ServerName oe.monweb.cn
DocumentRoot /var/www/oe/public
ErrorLog /var/log/httpd/oe-error_log
CustomLog /var/log/httpd/oe-access_logs combined
RewriteEngine On
BalancerMember http://127.0.0.1:6010 retry=10
BalancerMember http://127.0.0.1:6011 retry=10
BalancerMember http://127.0.0.1:6012 retry=10
# PERFORMANCE: If no static file exists, let Mongrel handle the request
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
Step2 install mongre-cluster
sudo gem install mongrel_cluster
you can start/stop/restart by commands
$ mongrel_rails cluster::start$ mongrel_rails cluster::stop
$ mongrel_rails cluster::restart
Step3 start app
In rails dir
mongrel_rails cluster::configure -e production -p 6010 -N 3
OK! Done
This article is created by 開心寫作網