利用Mongrel cluster和Apache搭建Rails服务器

Set mongrel cluster and apache for myShareBook.cn


1. Insall mongrel
2. Install apache
3. Create file in apache_root/myConf/my_share_book.conf
4. Config apache_conf


5. 将mods-available下的如下文件移到mods-enabled下

proxy.load
proxy.conf
proxy_http.load
proxy_balancer.load
rewrite.load


6. 打开apache2.conf以下几行没有被注释

Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
Include /etc/apache2/sites-enabled/

新加一行:
Include /etc/apache2/myConf/my_share_book.conf


7. 进入rails app目录,执行
mongrel_rails cluster::configure

看到此信息说明成功
Writing configuration file to config/mongrel_cluster.yml.

修改mongrel_cluster.yml

---
group: mysharebook.cn
address: 127.0.0.1
log_file: log/mongrel.log
port: "8000"
cwd: /var/www/apps/bookShare
environment: production
user: mysharebook.cn
pid_file: /var/www/apps/bookShare/tmp/pids
servers: 10

保存退出

8.进入rails app目录,执行
mongrel_rails cluster::start

看到如下信息说明成功

starting port 8000
starting port 8001
starting port 8002
starting port 8003
starting port 8004
starting port 8005
starting port 8006
starting port 8007
starting port 8008
starting port 8009


9. 启动apache
sudo /etc/init.d/apache2 restart


10. 在浏览器输入http://localhost/,看能否访问你的rails运用

如有兴趣,欢迎过来测试一下实际效果
[url=http://mysharebook.cn/]交换闲置书籍[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值