利用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运用

如有兴趣,欢迎过来测试一下实际效果
交换闲置书籍

你可能感兴趣的:(java,apache,浏览器,Rails)