Fedra core 5¤Ërails¤òapache + FastCGI¤Î¹½À®¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤·¤¿¤Î¤Ç¡¢¤½¤Î¥á¥â¤ò»Ä¤·¤Þ¤¹¡£ [smile]

[edit]

ή¤ì

¼¡¤Î¤è¤¦¤Êή¤ì¤Ë¤Ê¤ê¤Þ¤¹¡£

  1. fcgi¤Î¥¤¥ó¥¹¥È¡¼¥ë
    fcgi¤Ï´Ä¶­¤Ë°Í¸¤·¤Ê¤¤¾ïÃ󷿤ÎCGI¥×¥í¥»¥¹¤Î¥³¥ó¥Æ¥Ê(?)¤ß¤¿¤¤¤Ê¤â¤Î¤Ã¤Ý¤¤¡£
  2. mod_fcgi¤Î¥¤¥ó¥¹¥È¡¼¥ë
    apache¤Èfcgi¤òϢư¤µ¤»¤ë¤¿¤á¤ÎApache¥â¥¸¥å¡¼¥ë
  3. ruby¤Î¥¤¥ó¥¹¥È¡¼¥ë
    rails¤Ïruby¤Ç¤Ç¤­¤Æ¤ë¡£
  4. ruby-fcgi¤Î¥¤¥ó¥¹¥È¡¼¥ë
    ruby¤Çfcgi¤Î¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤Ç¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë»È¤¦ruby¤Î¥é¥¤¥Ö¥é¥ê¤Ã¤Ý¤¤¡£
  5. rails¤Î¥¤¥ó¥¹¥È¡¼¥ë
    ¤³¤ì¤¬Æþ¤ì¤¿¤¤¡£
[edit]

fcgi¤Î¥¤¥ó¥¹¥È¡¼¥ë

$ cd /usr/local/src/
$ wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
$ tar xzf fcgi-2.4.0.tar.gz
$ cd fcgi-2.4.0
$ ./configure
$ make
# make install
[edit]

mod_fcgi¤Î¥¤¥ó¥¹¥È¡¼¥ë

yum¤«¤é¡¢mod_fcgid¤È¤¤¤¦¤Î¤¬¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤ë¤Î¤Ç¤³¤ì¤ò»È¤¤¤Þ¤¹¡£

# yum install mod_fcgid

mod_fcgid¤È¤Ï?
mod_fcgid is a binary-compatible alternative to the Apache module mod_fastcgi.
mod_fcgid has a new process management strategy, which concentrates on reducing
the number of fastcgi servers, and kicking out corrupt fastcgi servers as soon
as possible
mod_fcgi¤È¸ß´¹À­¤¬¤¢¤ê¡¢mod_fcgi¤Ç¥È¥é¥Ö¥ë¤Ë¤Ê¤ê¤¬¤Á¤Ê¡¢¥×¥í¥»¥¹¿ô¤ÎÀ©¸æ¤¬¤â¤Ã¤ÈƬ¤¬¤è¤¯¤Ê¤Ã¤¿¤â¤È¡¢¤È¤¤¤¦´¶¤¸¤Ç¤·¤ç¤¦¤«¡£

[edit]

ruby¤Î¥¤¥ó¥¹¥È¡¼¥ë

¤³¤ì¤âyum¤Ç¥¤¥ó¥¹¥È¡¼¥ë¡£

# yum install ruby ruby-devel rdoc irb
[edit]

gems¤Î¥¤¥ó¥¹¥È¡¼¥ë

$ cd /usr/local/src/
$ wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
$ tar xzf rubygems-0.9.0.tgz
$ cd rubygems-0.9.0
# ruby setup.rb
[edit]

ruby-fcgi¤Î¥¤¥ó¥¹¥È¡¼¥ë

gems¤ÎFCGI¤Ç¤Ï¡¢

Dispatcher failed to catch: undefined method `is_cgi?' for 
FCGI:Class (NoMethodError)

¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬¤Ç¤Æ¤¦¤Þ¤¯¤¤¤«¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢ruby-fcgi¤òÆþ¤ì¤Þ¤·¤¿¡£

»²¹Í)http://sugi.nemui.org/prod/ruby-fcgi/

$ cd /usr/local/src/
$ tar xzf ruby-fcgi-0.8.6.tar.gz
$ ruby install.rb config
# ruby install.rb setup
[edit]

rake¤Î¥¤¥ó¥¹¥È¡¼¥ë

# gem install rake
[edit]

rails¤Î¥¤¥ó¥¹¥È¡¼¥ë

# gem install rails --include-dependencies
[edit]

;ÃÌ?


¼Â¤Ï¤³¤ì¤ä¤Ã¤Æ¤ë¤È¤­¡¢rubyforge.org¤¬Íî¤Á¤Æ¤Æ¥ê¥â¡¼¥È¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£ [sad]
¤Ê¤Î¤Ç¡¢
¡¡¡¡http://rubyforge.iasi.roedu.net/gems/
¤Ê¤É¤Î¥ß¥é¡¼¤«¤é¡¢¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤¤¥Õ¥¡¥¤¥ë¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬
¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¾õÂÖ¤Ç

# gem install activerecord -l

¤Î¤è¤¦¤Ë¥í¡¼¥«¥ë»ØÄꤷ¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤·¤¿¡£

[edit]

»î¤·¤Ë¥»¥Ã¥È¥¢¥Ã¥×

$ rails test

¥»¥Ã¥·¥ç¥ó¤È¡¢¥í¥°¥Õ¥¡¥¤¥ë¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òÍ¿¤¨¤ë

$ chmod ugo+w -R tmp log

¥Æ¥¹¥ÈÍѤÎcontroller¤Èaction¤òÍÑ°Õ¤¹¤ë

$ cd test
$ ./script/generate controller index
$ echo "aaa" > app/views/index/index.rhtml

ɽ¼¨¤·¤Æ¤ß¤ë¡£
¡¡http://my.domain/rails_root/public/index/index

Åê¹Æ¼Ô»ÖÅÄ | ¥Ñ¡¼¥Þ¥ê¥ó¥¯?

| append.gif

tag: rails?, FastCGI?, ¥Í¥Ã¥È¥ï¡¼¥¯?


¥È¥Ã¥×   ¿·µ¬ °ìÍ÷ ñ¸ì¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS

¥¢¡¼¥¯¥¦¥§¥Ö¤Î¥µ¡¼¥Ó¥¹¤ä¥½¥ê¥å¡¼¥·¥ç¥ó¤Ï¤³¤Á¤é