今まで mongrel を使って、Apache の mod_proxy でやっていたのですが、Redmine をインストールするときに知った Passenger を使ってみることにしました。
会社マシンに Passenger を入れたときにはいろいろモジュールが足りなくて何度もインストーラに怒られたのですが、自宅マシンだと一発で入りました。
あまりに簡単で記事にするほどでもないのですが、備忘録に。
# gem install passenger
Building native extensions.  This could take a while...
Successfully installed passenger-2.2.5
1 gem installed
Installing ri documentation for passenger-2.2.5...
Installing RDoc documentation for passenger-2.2.5...
# passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v2.2.5.

This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.

Here's what you can expect from the installation process:

 1. The Apache 2 module will be installed for you.
 2. You'll learn how to configure Apache.
 3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.


--------------------------------------------

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
 * Apache 2... found at /usr/local/sbin/httpd
 * Apache 2 development headers... found at /usr/local/sbin/apxs
 * Apache Portable Runtime (APR) development headers... found at /usr/local/bin/apr-1-config
 * Apache Portable Runtime Utility (APU) development headers... found at /usr/local/bin/apu-1-config

--------------------------------------------
(・・mod_passengerのコンパイル&インストール・・)
--------------------------------------------
The Apache 2 module was successfully installed.

Please edit your Apache configuration file, and add these lines:

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

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!

Press ENTER to continue.


--------------------------------------------
Deploying a Ruby on Rails application: an example

Suppose you have a Ruby on Rails application in /somewhere. Add a virtual host
to your Apache configuration file, and set its DocumentRoot to
/somewhere/public, like this:

   
      ServerName www.yourhost.com
      DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
   

And that's it! You may also want to check the Users Guide for security and
optimization tips and other useful information:

  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.5/doc/Users guide Apache.html

Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
http://www.modrails.com/

Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.
後は、passenger-install-apache2-module に表示されたとおりに apacheの設定ファイルを変えるだけ。
もともと mongrel に飛ばす設定が書いてあったので、LoadModule からの3行の追加とProxyPass* の行を消すだけであっけなく動きました。
後は、mongrelを止めて終わりです。
Railsアプリをちょっといじったときは、$RAILS_ROOT/tmp/restart.txt と言うファイルを作成すればそのアプリだけ再起動してくれるそうです。

カテゴリ

トラックバック(0)

このブログ記事を参照しているブログ一覧: fastladder を Passenger で

このブログ記事に対するトラックバックURL: https://www.wizard-limit.net/cgi-bin/mt/mt-tb.cgi/2128

コメントする

このブログ記事について

このページは、falseが2009年9月10日 09:37に書いたブログ記事です。

ひとつ前のブログ記事は「fastladder を PostgreSQLで動かす」です。

次のブログ記事は「CustomFeed::MixiScraperでmixiの画像をローカル保存」です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。

広告

Powered by Movable Type 6.1.1