本页主题: Apache + "Ruby on Rails" on FreeBSD 打印 | 加为IE收藏 | 复制链接 | 收藏主题 | 上一主题 | 下一主题

admin
级别: 管理员


精华: 1
发帖: 4635
威望: 47 点
金钱: 23188 RMB
贡献值: 0 点
注册时间:2006-10-09
最后登录:2008-07-17

 Apache + "Ruby on Rails" on FreeBSD

Memo
mod_ruby or fastcgi: http://www.ruby-forum.com/topic/57084#44202
from some articles, mod_ruby seems to be slower(?), anyway, FastCGI is fast enough
getting start for Ruby on Rails: Rolling with Ruby on Rails
Install Procedure
Ruby is executed through CGI, FastCGI will get much faster response.

install apache2
I got problems when running FastCGI on apache13. There is no error message in httpd-error.log and RAILS/log/*/*, while the page displays “Application error Rails application failed to start properly”. I'm sure that the same setting works with CGI.
install FastCGI
# cd /usr/ports/www/mod_fastcgi/
# make install clean
install the language Ruby
# cd /usr/ports/lang/ruby18
# make install clean
install Ruby on Rails (this will also install language ruby)
# cd /usr/ports/www/rubygem-rails
# make install clean
(use root to run the following command, otherwise it won't work)
# gem update
# gem install rails
setup apache, /usr/local/etc/apache2/Include/ruby_on_rails.conf:
LoadModule fastcgi_module libexec/apache2/mod_fastcgi.so
<Directory "/usr/local/www/data/rails">
    Options Indexes FollowSymLinks MultiViews ExecCGI
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>
AllowOverride → rails need .htaccess to run CGI or FastCGI
build rail repository
# cd /usr/local/www/data/
# rails rails
web pages are placed on http://document_root/rails/public/

force rails to use FastCGI, rails use CGI in default. edit RAILS/public/.htaccess: uncomment this line:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
and comment this line:

#RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
remember to place the RewriteRule to the last line, otherwise we can't read CSS file
Notes
if there is something wrong, see RAILS/log/*
RAILS/tmp, /tmp/* must be writable by www daemon
Reference
http://www.rubyonrails.org/down
http://wiki.rubyonrails.com/rails/pages/GettingStartedWithRails
http://www.infused.org/2005/03/19/ruby-on-rails-apache-fastcgi-and-ensim/
http://www.twbb.org/viewthread.php?tid=17093


http://www.pighouse.net/~fcamel/Wiki/doku.php?id=system:apache_ruby_on_rails
Posted: 2008-05-13 12:33 | [楼 主]
niu3654
级别: 新手上路


精华: 0
发帖: 9
威望: -5 点
金钱: -60 RMB
贡献值: 0 点
注册时间:2008-06-27
最后登录:2008-07-01

 拼命支持

正所谓:“骂而无形,讥于无影,笑骂之中传奇世界私服显真功 !”楼主真不愧为讽刺界新一代的开山长毛鼻祖!本来我已经对这个系词社区绝望了,觉得这个社区不可能再有明天了,心里充满了伤感。但是今日所见you的这个帖子,又重新让偶看 到了八卦的希望。是runescape让我的心里重新燃起希望的火花,是you让偶的心又重新跳动起来,是you拯救了偶一颗哇凉哇凉的心,并挽救了一个无 知的灵魂!本来偶已决定不会在系词回任何帖子了,但是今日拜读魔域私服之高作,偶告诉自己如此经典之贴是一定要回的!这是千百年来版友翘首以 待的好贴啊!苍天开眼啊,让偶在对社区心灰意冷之时得以观得如此精彩绝伦的传奇私服好贴!楼猪,you是系词的希望啊,you要担起系词兴旺之大任啊!
偶一定会追随你左右,偶坚定此贴必然会起到抛砖引玉的作用,更坚信在偶有生之年必然会有更多象楼猪一样的猪来八卦畅所欲言、发表高见,不管明天会是如何,今夜梦中,偶会笑容灿烂,因为,偶终于知道了,此番人世,得此一贴,无憾矣!在逐字逐句
完美世界私服地看完这个帖子以后,我的心久久不能平静,震撼啊!为什么会有如此好的帖子?!我纵横网络bbs多年,自以为再也不会有任何帖子能打动我,没想到今天看到了如此精妙绝伦的这样一篇帖子。 楼主,是你让我深深地理解了‘人外有人,天外有天’这句话。谢谢侬!
Posted: 2008-07-01 13:12 | 1 楼
帖子浏览记录 版块浏览记录
承德互联 » unix专区

Total 1.255636(s) query 5, Time now is:07-20 03:26, Gzip enabled
Powered by PHPWind v6.0 Certificate Code © 2003-07 PHPWind.com Corporation