关于Mongrel的安装和使用
安装只要通过以下命令即可 :
gem install Cinclude-dependencies mongrel
gem install Cinclude-dependencies mongrel_cluster
安装过程中选择(ruby)的选项
--------------------------------
使用方式:
Mongre_cluster的设置比较简单,在你的Rails应用的根目录下运行,以下假设Rails的应用程序目录为/path/to/railsapp/
#mongrel_rails cluster::configure -e production -p 8000 -a 127.0.0.1 -N 2 -c /path/to/railsapp/
解释一下:
-e 指定运行环境,有production(生产)、development(开发)、test(测试)三个选项。
-p 指定监听端口
-a 127.0.0.1 指定Mongrel在localhost下监听
-N 2 启动两个Mongrel进程,端口从8000~8001
运行后,会在应用程序目录 config/mongrel_cluster.yml, 以后有什么变化,直接修改这个文件就可以了。
在终端下输入以下命令启动Mongrel:
mongrel_rails cluster::start
要停止则输入:
mongrel_rails cluster::stop