0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
阅读:1418回复:0

在Debian上安裝Ruby On Rails環境

楼主#
更多 发布于:2007-07-25 21:42
在Debian上安裝Ruby On Rails環境

原文地址:  http://color-magic.cn/archives/58

新起一個開發服務器,Debian系統,需要安裝Ruby on rails環境
參考:
Ruby on Rails on Debian
Debian下为Apache2配置FastCGI(mod-fcgid),PHP5,Perl,Python,ROR

已有環境:Apache2.2, php5

1.安裝Ruby
# apt-get install ruby libzlib-ruby rdoc irb

2.安裝Gems
這裡與上面的參考不一樣,apt-cache search了一下發現可以直接apt-get安裝
# apt-get install rubygems

3.安裝Rails
同樣apt-cache search發現源裡面也有,但是怕出問題(什麼奇怪的想法),還是老老實實地用gem安裝了
gem install rails --include-dependencies

4.安裝fast_cgi和libfcgi-ruby1.8
和上面參考不一樣,它用的apache1.x,所以直接用libapache-mod-fastcgi,我的是2.2,試試裝了這東西:
libapache2-mod-fcgid - an alternative module compat with mod_fastcgi
# apt-get install libapache2-mod-fcgid libfcgi-ruby1.8

5.配置虛擬主機
這個不多說,虛擬主機目錄為rails應用下的public目錄,apache2需要打開rewrite引擎
# ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

並在虛擬主機中加入以下rewrite方案
RewriteEngine On
# Let apache handle purely static files like images by itself.
RewriteCond %{REQUEST_FILENAME} !-f
# Send Everything else to Typo
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

http://color-magic.cn/archives/58
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
游客

返回顶部