Passengerインストール

CentOS5.4でApacheはyumでインストールしたものを使用。
ソースから入れたものだと別途入れるものが結構あるのでyumの方が楽。

3分で終わるよ!!などというメッセージでるけどそんなことは稀

It shouldn't take more than 3 minutes in total.

インストール

sudo gem install passenger
# rootで実行しないといろいろと面倒なことが起きるそう
su - 
passenger-install-apache2-module

必要な物の確認すべてインストールされていればOK

Checking for required software...

 * GNU C++ compiler... found at /usr/bin/g++
 * Ruby development headers... found
 * OpenSSL support for Ruby... found
 * RubyGems... found
 * Rake... found at /usr/local/bin/rake
 * rack... found
 * Apache 2... found at /usr/sbin/httpd
 * Apache 2 development headers... not found
 * Apache Portable Runtime (APR) development headers... not found
 * Apache Portable Runtime Utility (APU) development headers... not found

not foundだったものをインストールする

Installation instructions for required software

 * To install Apache 2 development headers:
   Please run yum install httpd-devel as root.

 * To install Apache Portable Runtime (APR) development headers:
   Please run yum install apr-devel as root.

再度下記を実行

passenger-install-apache2-module

httpd.confに下記を追記
(コメントは消さないとエラーになるので消しておく)

   LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
   PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11
   PassengerRuby /usr/local/bin/ruby

   <VirtualHost *:80>
      ServerName www.yourhost.com
      DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
      <Directory /somewhere/public>
         AllowOverride all              # <-- relax Apache security settings
         Options -MultiViews            # <-- MultiViews must be turned off
      </Directory>
   </VirtualHost>

Apacheを起動するとRailsプロジェクトをみることができる。