apache+mongrel+rails+linux服务器应该如何配置
1.首先在服务器上搭建RAILS环境并装mongrel 和apache
#install ruby
apt-get install irb libdbm-ruby1.8 libgdbm-ruby1.8 libmysql-ruby1.8 libmysqlclient14 libopenssl-ruby1.8 libruby1.8-dbg mysql-common ri ri1.8 ruby1.8-dev
#install rubygem
#http://rubyforge.org/projects/rubygems/
wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
tar zxfv rubygems-0.9.0.tgz
cd rubygems-0.9.0
ruby setup.rb
gem update –system
#install Rails and dependencies
gem install rails –include-dependencies
#install Mysql
apt-get install mysql-server
#intall Mongrel
apt-get install build-essentia l
gem install mongrel –include-dependencies
2. 配置Apache2
ProxyRequests Off
BalancerMember http://127.0.0.1:3001
BalancerMember http://127.0.0.1:3002
BalancerMember http://127.0.0.1:3003
BalancerMember http://127.0.0.1:3004
BalancerMember http://127.0.0.1:3005
ServerName *.xxx.com:80
DocumentRoot /usr/xxx/public
ProxyPass /image !
ProxyPass /stylesheets !
ProxyPass /javascripts !
ProxyPass / balancer://myCluster/
ProxyPassReverse / balancer://myCluster/
ProxyPreserveHost on
3.然后在3001,3002...3005端口启动mongrel
mongrel_rails start -e production -p 3001 -d -c /usr/xxx/xxx/ -P /usr/xxx/xxx/log/mongrel-3001.pid
mongrel_rails start -e production -p 3001 -d -c /usr/xxx/xxx/ -P /usr/xxx/xxx/log/mongrel-3002.pid
...
mongrel_rails start -e production -p 3001 -d -c /usr/xxx/xxx/ -P /usr/xxx/xxx/log/mongrel-3005.pid
以上就是爱站技术频道小编为大家分享的轻松架构apache+mongrel+rails+linux服务器的详细步骤,如果你也想搭建这样的服务环境,可以直接参考本文。