ホーム DoRuby mongrelのinstallと設定と起動の方法

mongrelのinstallと設定と起動の方法

この記事はアピリッツの技術ブログ「DoRuby」から移行した記事です。情報が古い可能性がありますのでご注意ください。

ども、rick No.15です。
今回はmongrelの
・install方法
・設定方法
・起動方法
・停止方法
なんかを紹介します。

mongrel install

$ gem install mongrel
$ gem install daemons
$ gem install mongrel_cluster

mongrel設定

$ vim config/mongrel_cluster.yml
——————————
# portの数を変えたいときは
user: test
cwd: /var/www/test # ソースの場所
port: “3000” # ここでportの番号を変更する
environment: production
group: test
pid_file: log/mongrel.pid
servers: 5 # ここでportの数を変更する
—————————————

起動

$ mongrel_rails cluster::start

停止

$ mongrel_rails cluster::stop

再起動

$ mongrel_rails cluster::restart

mongrelの数が一個だけでいい場合は
$ ruby script/server
———————————————————————————————-
./script/../config/boot.rb:26:Warning: Gem::SourceIndex#search support for String patterns is deprecated
=> Booting Mongrel (use ‘script/server webrick’ to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment…
———————————————————————————————-

と起動すればOK
webrick (毎回設定ファイルを再読込み)で起動したい場合は
$ ruby script/server webrick
———————————
=> Booting WEBrick…
~
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with –help for options
[2009-10-22 12:11:34] INFO WEBrick 1.3.1
[2009-10-22 12:11:34] INFO ruby 1.8.6 (2008-08-11) [universal-darwin9.0]
[2009-10-22 12:11:34] INFO WEBrick::HTTPServer#start: pid=684 port=3000
———————————

と起動すればOK
以上〜。

記事を共有

最近人気な記事