- ¥Ð¥Ã¥¯¥¢¥Ã¥×°ìÍ÷
- ¥½¡¼¥¹ ¤òɽ¼¨
- Ruby on Rails/Fedra Core5¤ÇApache2+FastCGI¤Î¥»¥Ã¥È¥¢¥Ã¥× ¤Ïºï½ü¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
- 1 (2006-10-13 (¶â) 19:59:12)
- 2 (2006-10-13 (¶â) 20:26:06)
- 3 (2007-01-03 (¿å) 19:40:30)
Fedra core 5¤Ërails¤òapache + FastCGI¤Î¹½À®¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤·¤¿¤Î¤Ç¡¢¤½¤Î¥á¥â¤ò»Ä¤·¤Þ¤¹¡£
ή¤ì †
¼¡¤Î¤è¤¦¤Êή¤ì¤Ë¤Ê¤ê¤Þ¤¹¡£
- fcgi¤Î¥¤¥ó¥¹¥È¡¼¥ë
fcgi¤Ï´Ä¶¤Ë°Í¸¤·¤Ê¤¤¾ïÃ󷿤ÎCGI¥×¥í¥»¥¹¤Î¥³¥ó¥Æ¥Ê(?)¤ß¤¿¤¤¤Ê¤â¤Î¤Ã¤Ý¤¤¡£ - mod_fcgi¤Î¥¤¥ó¥¹¥È¡¼¥ë
apache¤Èfcgi¤òϢư¤µ¤»¤ë¤¿¤á¤ÎApache¥â¥¸¥å¡¼¥ë - ruby¤Î¥¤¥ó¥¹¥È¡¼¥ë
rails¤Ïruby¤Ç¤Ç¤¤Æ¤ë¡£ - ruby-fcgi¤Î¥¤¥ó¥¹¥È¡¼¥ë
ruby¤Çfcgi¤Î¥Õ¥ì¡¼¥à¥ï¡¼¥¯¤Ç¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë»È¤¦ruby¤Î¥é¥¤¥Ö¥é¥ê¤Ã¤Ý¤¤¡£ - rails¤Î¥¤¥ó¥¹¥È¡¼¥ë
¤³¤ì¤¬Æþ¤ì¤¿¤¤¡£
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
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¤Ç¥È¥é¥Ö¥ë¤Ë¤Ê¤ê¤¬¤Á¤Ê¡¢¥×¥í¥»¥¹¿ô¤ÎÀ©¸æ¤¬¤â¤Ã¤ÈƬ¤¬¤è¤¯¤Ê¤Ã¤¿¤â¤È¡¢¤È¤¤¤¦´¶¤¸¤Ç¤·¤ç¤¦¤«¡£
ruby¤Î¥¤¥ó¥¹¥È¡¼¥ë †
¤³¤ì¤âyum¤Ç¥¤¥ó¥¹¥È¡¼¥ë¡£
# yum install ruby ruby-devel rdoc irb
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
ruby-fcgi¤Î¥¤¥ó¥¹¥È¡¼¥ë †
gems¤ÎFCGI¤Ç¤Ï¡¢
Dispatcher failed to catch: undefined method `is_cgi?' for FCGI:Class (NoMethodError)
¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬¤Ç¤Æ¤¦¤Þ¤¯¤¤¤«¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢ruby-fcgi¤òÆþ¤ì¤Þ¤·¤¿¡£
$ cd /usr/local/src/ $ tar xzf ruby-fcgi-0.8.6.tar.gz $ ruby install.rb config # ruby install.rb setup
rake¤Î¥¤¥ó¥¹¥È¡¼¥ë †
# gem install rake
rails¤Î¥¤¥ó¥¹¥È¡¼¥ë †
# gem install rails --include-dependencies
;ÃÌ? †
¼Â¤Ï¤³¤ì¤ä¤Ã¤Æ¤ë¤È¤¡¢rubyforge.org¤¬Íî¤Á¤Æ¤Æ¥ê¥â¡¼¥È¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£
¤Ê¤Î¤Ç¡¢
¡¡¡¡http://rubyforge.iasi.roedu.net/gems/
¤Ê¤É¤Î¥ß¥é¡¼¤«¤é¡¢¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤¤¥Õ¥¡¥¤¥ë¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬
¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¾õÂÖ¤Ç# gem install activerecord -l¤Î¤è¤¦¤Ë¥í¡¼¥«¥ë»ØÄꤷ¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤·¤¿¡£
»î¤·¤Ë¥»¥Ã¥È¥¢¥Ã¥× †
$ 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
- dfgdsfgsdf -- 2007-01-03 (¿å) 19:40:29