最終更新日: 2016-06-26 日 01:24
ホーム | 文書トップ | 目次

Ruby、Passenger(mod_rails)環境の構築(Debian 5.0)

Table of Contents

概要

Debian 5.0(lenny) にRuby、Passenger(mod_rails)環境を構築する方法である。

全体の流れ

  • ruby、gems、rake のインストール
    • パッケージマネージャにより、ruby と rubygems を入れる
      • rakeは入れない
    • rubygems をアップデート
    • gem にて rake を入れる
  • Passengerのインストール
    • gemで 必要なパッケージを入れる
    • apache2 の必要なパッケージを入れる
    • apache2 へのモジュールのインストール

ruby、gems、rake のインストール

パッケージインストール

  • パッケージマネージャにより、下記をインストール
  • ruby1.8 (1.8.7.72-3lenny1)
    • libruby1.8 (1.8.7.72-3lenny1)
  • rubygems1.8 (1.2.0-3)
    • irb1.8 (1.8.7.72-3lenny1)
    • libreadline-ruby1.8 (1.8.7.72-3lenny1)
    • rdoc1.8 (1.8.7.72-3lenny1)
  • ruby1.8-dev (1.8.7.72-3lenny1)
  • libopenssl-ruby1.8 (1.8.7.72-3lenny1)

gemsのアップデート

現在のバージョン

  • 1.2.0
$ sudo gem --version
1.2.0

rubygemsのアップデート

#+BEGIN_EXAMPLE $ sudo /var/lib/gems/1.8/bin/update_rubygems Installing RubyGems 1.3.1 mkdir -p /usr/local/lib/site_ruby/1.8 mkdir -p /usr/bin mkdir -p /usr/local/lib/site_ruby/1.8/rubygems install -c -m 0644 rubygems/gem_runner.rb /usr/local/lib/site_ruby/1.8/rubygems/gem_runner.rb

(中略)

install -c -m 0644 rubygems/package.rb /usr/local/lib/site_ruby/1.8/rubygems/package.rb install -c -m 0644 ubygems.rb /usr/local/lib/site_ruby/1.8/ubygems.rb mkdir -p /usr/local/lib/site_ruby/1.8/rbconfig install -c -m 0644 rbconfig/datadir.rb /usr/local/lib/site_ruby/1.8/rbconfig/datadir.rb install -c -m 0644 rubygems.rb /usr/local/lib/site_ruby/1.8/rubygems.rb cp gem /tmp/gem install -c -m 0755 /tmp/gem /usr/bin/gem1.8 rm /tmp/gem rm -f /usr/lib/ruby/gems/1.8/source_cache Removing old RubyGems RDoc and ri Installing rubygems-1.3.1 ri into /usr/lib/ruby/gems/1.8/doc/rubygems-1.3.1/ri Installing rubygems-1.3.1 rdoc into /usr/lib/ruby/gems/1.8/doc/rubygems-1.3.1/rdoc


= Announce: RubyGems Release 1.3.0

NOTE: RubyGems 1.1 and 1.2 have problems upgrading when there is no rubygems-update installed. You will need to follow the second set of update instructions if you see "Nothing to update".

Release 1.3.0 fixes some bugs.

Bugs fixed:

Disregard ownership of ~ under Windows while creating ~/.gem. Fixes

issues related to no uid support under Windows.

Fix requires for Gem::inflate, Gem::deflate, etc.

Make Gem.dir respect :gemhome value from config. (Note: this feature may be

removed since it is hard to implement on 1.9.)

Kernel methods are now private. Patch #20801 by Stefan Rusterholz.

Gem::location_of_caller now behaves on Windows. Patch by Daniel Berger.

Silence PATH warning.

Deprecation Notices:

Gem::manage_gems will be removed on or after March 2009.

For a full list of changes to RubyGems and the contributor for each change, see the ChangeLog file.

Special thanks to Chad Wooley for backwards compatibility testing and Luis Lavena for continuing windows support.

== How can I get RubyGems?

NOTE: If you have installed RubyGems using a package system you may want to install a new RubyGems through the same packaging system.

If you have a recent version of RubyGems (0.8.5 or later), then all you need to do is:

$ gem update –system (you might need to be admin/root)

NOTE: RubyGems 1.1 and 1.2 have problems upgrading when there is no rubygems-update installed. You will need to follow the second set of update instructions if you see "Nothing to update".

NOTE: You may have to run the command twice if you have any previosly installed rubygems-update gems.

If you have an older version of RubyGems installed, then you can still do it in two steps:

$ gem install rubygems-update (again, might need to be admin/root) $ update_rubygems (… here too)

If you don't have any gems install, there is still the pre-gem approach to getting software … doing it manually:

  1. DOWNLOAD FROM: http://rubyforge.org/frs/?group_id=126
  2. UNPACK INTO A DIRECTORY AND CD THERE
  3. INSTALL WITH: ruby setup.rb (you may need admin/root privilege)

== To File Bugs

The RubyGems bug tracker can be found on RubyForge at: http://rubyforge.org/tracker/?func=add&group_id=126&atid=575

When filing a bug, `gem env` output will be helpful in diagnosing the issue.

If you find a bug where RubyGems crashes, please provide debug output. You can do that with `gem –debug the_command`.

== Thanks

Keep those gems coming!

– Jim & Chad & Eric (for the RubyGems team)


RubyGems installed the following executables: /usr/bin/gem1.8

If `gem` was installed by a previous RubyGems installation, you may need to remove it by hand. #+END_EXAMPLE

1.3.1にアップデート完了

バージョンを確認する。

$ gem -v
1.3.1

1.3.1から1.3.5へのアップデート

下記を実行する。

gem install rubygems-update
/var/lib/gems/1.8/bin/update_rubygems
  • 実行例
$ sudo gem install rubygems-update
Successfully installed rubygems-update-1.3.5
1 gem installed
Installing ri documentation for rubygems-update-1.3.5...

Installing RDoc documentation for rubygems-update-1.3.5...
Could not find main page README
Could not find main page README
Could not find main page README
Could not find main page README

#+BEGIN_EXAMPLE $ sudo /var/lib/gems/1.8/bin/update_rubygems Installing RubyGems 1.3.5 RubyGems 1.3.5 installed

= 1.3.5 / 2009-07-21

Bug fixes:

Fix use of prerelease gems.

Gem.bin_path no longer escapes path with spaces. Bug #25935 and #26458.

Deprecation Notices:

Bulk index update is no longer supported (the code currently remains, but not

the tests)

Gem::manage_gems was removed in 1.3.3.

Time::today was removed in 1.3.3.


RubyGems installed the following executables: /usr/bin/gem1.8 #+END_EXAMPLE

1.3.5にアップデート完了

バージョンを確認する。

$ gem -v
1.3.5

rake のインストール

$ sudo gem install rake
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7...
Installing RDoc documentation for rake-0.8.7...

Passenger のインストール

必要なパッケージのインストール

  • fastthread のインストール
$ sudo gem install fastthread
Building native extensions.  This could take a while...
Successfully installed fastthread-1.0.7
1 gem installed
Installing ri documentation for fastthread-1.0.7...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump
Installing RDoc documentation for fastthread-1.0.7...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump

Passenger自身のインストール

$ sudo gem install passenger
Building native extensions.  This could take a while...
Successfully installed passenger-2.2.7
1 gem installed
Installing ri documentation for passenger-2.2.7...
Installing RDoc documentation for passenger-2.2.7...

apxs (apache2-prefork-dev) のインストール

apache2にPassengerのモジュールをインストールする為には、apxs が必要

  • 具体的には、apache2-prefork-dev というのを入れた(依存するパッケージがやたら多い)
  • apache2-prefork-dev (2.2.9-10+lenny6)
    • comerr-dev (2.1-1.41.3-1)
    • libapr1-dev (1.2.12-5+lenny1)
    • libaprutil1-dev (1.2.12+dfsg-8+lenny4)
    • libdb4.6-dev (4.6.21-11)
    • libexpat1-dev (2.0.1-4+lenny1)
    • libkadm55 (1.6.dfsg.4~beta1-5lenny1)
    • libkrb5-dev (1.6.dfsg.4~beta1-5lenny1)
    • libldap2-dev (2.4.11-1)
    • libmysqlclient15-dev (5.0.51a-24+lenny2)
    • libpcre3-dev (7.6-2.1)
    • libpcrecpp0 (7.6-2.1)
    • libpq-dev (8.3.8-0lenny1)
    • libsqlite3-dev (3.5.9-6)
    • libssl-dev (0.9.8g-15+lenny5)
    • uuid-dev (1.2-1.41.3-1)
    • zlib1g-dev (1:1.2.3.3.dfsg-12)

apache2 へのモジュールのインストール

apache2 へのモジュールのインストールする際には、下記コマンドを実行する。

passenger-install-apache2-module

わかりにくいが、このインストーラは rake を使用するが、実際のモジュールは C++コンパイラ(g++)にてコンパイルされる。 つまり、従来の make の替りに rake を使うイメージ

  • 下記のように言われる場合
* OpenSSL support for Ruby... not found
  • 下記のパッケージが入っていることを確認する
  • libopenssl-ruby1.8 (1.8.7.72-3lenny1)
$ sudo passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v2.2.7.

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

--------------------------------------------
Compiling and installing Apache 2 module...
cd /usr/lib/ruby/gems/1.8/gems/passenger-2.2.7
/usr/bin/ruby1.8 -S /usr/bin/rake clean apache2
# /usr/bin/ruby1.8 -S /usr/bin/rake clean apache2
(in /usr/lib/ruby/gems/1.8/gems/passenger-2.2.7)
rm -rf ext/apache2/libboost_oxt.a ext/apache2/libboost_oxt
rm -rf ext/apache2/libpassenger_common.a ext/apache2/ApplicationPoolServerExecutable ext/apache2/libpassenger_common
rm -rf ext/apache2/Configuration.o ext/apache2/Bucket.o ext/apache2/Hooks.o ext/apache2/mod_passenger.o ext/apache2/mod_passenger.so
rm -rf ext/nginx/libboost_oxt.a ext/nginx/libboost_oxt
rm -rf ext/nginx/libpassenger_common.a ext/nginx/libpassenger_common
rm -rf ext/nginx/HelperServer
rm -rf test/libboost_oxt.a test/libboost_oxt
rm -rf test/libpassenger_common.a test/ApplicationPoolServerExecutable test/libpassenger_common
rm -rf test/oxt/oxt_test_main test/oxt/*.o test/CxxTests test/*.o
rm -r pkg
cd ext/phusion_passenger && make clean
rm -f ext/phusion_passenger/Makefile
mkdir -p ext/apache2/libpassenger_common
g++ -Iext -Iext/common -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libpassenger_common/Utils.o -c ext/common/Utils.cpp
g++ -Iext -Iext/common -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libpassenger_common/Logging.o -c ext/common/Logging.cpp
g++ -Iext -Iext/common -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libpassenger_common/SystemTime.o -c ext/common/SystemTime.cpp
g++ -Iext -Iext/common -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libpassenger_common/CachedFileStat.o -c ext/common/CachedFileStat.cpp
g++ -Iext -Iext/common -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libpassenger_common/Base64.o -c ext/common/Base64.cpp
mkdir -p ext/apache2/libpassenger_common
rm -rf ext/apache2/libpassenger_common.a
ar cru ext/apache2/libpassenger_common.a ext/apache2/libpassenger_common/*.o
ranlib ext/apache2/libpassenger_common.a
mkdir -p ext/apache2/libboost_oxt/boost
g++ -Iext -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libboost_oxt/boost/once.o -c ext/boost/src/pthread/once.cpp
g++ -Iext -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libboost_oxt/boost/exceptions.o -c ext/boost/src/pthread/exceptions.cpp
g++ -Iext -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libboost_oxt/boost/thread.o -c ext/boost/src/pthread/thread.cpp
mkdir -p ext/apache2/libboost_oxt/oxt
g++ -Iext -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libboost_oxt/oxt/system_calls.o -c ext/oxt/system_calls.cpp
g++ -Iext -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libboost_oxt/oxt/backtrace.o -c ext/oxt/backtrace.cpp
g++ -Iext -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libboost_oxt/oxt/tracable_exception.o -c ext/oxt/tracable_exception.cpp
g++ -Iext -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/libboost_oxt/oxt/thread.o -c ext/oxt/thread.cpp
mkdir -p ext/apache2/libboost_oxt/boost ext/apache2/libboost_oxt/oxt
rm -rf ext/apache2/libboost_oxt.a
ar cru ext/apache2/libboost_oxt.a ext/apache2/libboost_oxt/boost/*.o ext/apache2/libboost_oxt/oxt/*.o
ranlib ext/apache2/libboost_oxt.a
g++ ext/common/ApplicationPoolServerExecutable.cpp -o ext/apache2/ApplicationPoolServerExecutable -Iext -Iext/common  -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS ext/apache2/libpassenger_common.a ext/apache2/libboost_oxt.a  -lpthread
gcc -Iext -Iext/common -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/mod_passenger.o -c ext/apache2/mod_passenger.c
g++ -Iext -Iext/common -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/Configuration.o -c ext/apache2/Configuration.cpp
g++ -Iext -Iext/common -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/Bucket.o -c ext/apache2/Bucket.cpp
g++ -Iext -Iext/common -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/Hooks.o -c ext/apache2/Hooks.cpp
g++ -shared ext/apache2/Configuration.o ext/apache2/Bucket.o ext/apache2/Hooks.o ext/apache2/mod_passenger.o -fPIC -o ext/apache2/mod_passenger.so -fPIC -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS ext/apache2/libpassenger_common.a ext/apache2/libboost_oxt.a -fPIC -L/usr/lib -lapr-1 -L/usr/lib -laprutil-1 -lpthread
cd ext/phusion_passenger && /usr/bin/ruby1.8 extconf.rb
creating Makefile
cd ext/phusion_passenger && make
cc -I. -I/usr/lib/ruby/1.8/i486-linux -I/usr/lib/ruby/1.8/i486-linux -I. -D_FILE_OFFSET_BITS=64  -fPIC -fno-strict-aliasing -g -g -O2  -fPIC   -c native_support.c
cc -shared -o native_support.so native_support.o -L. -L/usr/lib -L.  -rdynamic -Wl,-export-dynamic    -lruby1.8

--------------------------------------------
The Apache 2 module was successfully installed.

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

   LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.7/ext/apache2/mod_passenger.so
   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.7
   PassengerRuby /usr/bin/ruby1.8

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 Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:

   <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>

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

  /usr/lib/ruby/gems/1.8/gems/passenger-2.2.7/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.

apache2の設定

$ ls /usr/lib/ruby/gems/1.8/gems/passenger-2.2.7/ext/apache2/
ApplicationPoolServerExecutable  Configuration.cpp  Hooks.cpp         libboost_oxt           mod_passenger.c
Bucket.cpp                       Configuration.h    Hooks.h           libboost_oxt.a         mod_passenger.o
Bucket.h                         Configuration.o    Hooks.o           libpassenger_common    mod_passenger.so
Bucket.o                         DirectoryMapper.h  LICENSE-CNRI.TXT  libpassenger_common.a
  • /etc/apache2/mods-available/passenger.load
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.7/ext/apache2/mod_passenger.so
  • /etc/apache2/mods-available/passenger.conf
<IfModule mod_passenger.c>
   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.7
   PassengerRuby /usr/bin/ruby1.8
</IfModule>
  • a2enmod を実行する
$ sudo a2enmod passenger
Enabling module passenger.
Run '/etc/init.d/apache2 restart' to activate new configuration!
  • apache2再起動
sudo /etc/init.d/apache2 restart
  • これでPassengerはインストールは完了

RailsBaseURIの設定

  • /etc/apache2/sites-available/default の<VirtualHost>〜</VirtualHost> の間に下記を記述する。
  • 下記は、redmine の例
RailsBaseURI /redmine/public
ホーム | 文書トップ | 目次
Created by Emacs 27.1 (Org mode 9.3)