$ sudo a2enmod proxy proxy_http proxy_balancerConfigure Proxy in a virtual host
/etc/apache2/site-enabled/default add
DocumentRoot "RailsApp/public"
# even only RailsApp also work
ProxyPass / balancer://localhost/
ProxyPassReverse / balancer://localhost/
< proxy balancer://localhost/ >
BalanceMember http://localhost:3000
BalanceMember http://localhost:3001
BalanceMember http://localhost:3002
< /proxy >Then set mongrel cluster
$ sudo gem install mongrel_cluster
$ cd RailsApp
$ mongrel_rails cluster::configure -e development -p 3000 -N 3
# write config/mongrel_cluster.yml
$ mongrel_rails cluster::startFinal, restart apache2 and it work.


0 意見:
張貼意見