passenger インストール

で、順序が逆ですが passenger をインストールしてみました。apache をソースから入れていたため一部はまりましたが、id:mingos:20080413:1208093544 のおかげで解決 :)。


ちょっと長いですがどなたかの参考になるかもしれないので、そのまま載せておきます。

# gem install passenger
Building native extensions.  This could take a while...
Successfully installed rack-0.3.0
Successfully installed passenger-2.0.2
2 gems installed
Installing ri documentation for rack-0.3.0...
Installing ri documentation for passenger-2.0.2...
Installing RDoc documentation for rack-0.3.0...
Installing RDoc documentation for passenger-2.0.2...
./doc/template/horo.rb:17: warning: already initialized constant FONTS
./doc/template/horo.rb:19: warning: already initialized constant STYLE
./doc/template/horo.rb:213: warning: already initialized constant XHTML_PREAMBLE
./doc/template/horo.rb:221: warning: already initialized constant HEADER
./doc/template/horo.rb:272: warning: already initialized constant FILE_PAGE
./doc/template/horo.rb:300: warning: already initialized constant CLASS_PAGE
./doc/template/horo.rb:338: warning: already initialized constant METHOD_LIST
./doc/template/horo.rb:486: warning: already initialized constant FOOTER
./doc/template/horo.rb:491: warning: already initialized constant BODY
./doc/template/horo.rb:503: warning: already initialized constant SRC_PAGE
./doc/template/horo.rb:531: warning: already initialized constant FR_INDEX_BODY
./doc/template/horo.rb:535: warning: already initialized constant FILE_INDEX
./doc/template/horo.rb:583: warning: already initialized constant CLASS_INDEX
./doc/template/horo.rb:584: warning: already initialized constant METHOD_INDEX
./doc/template/horo.rb:586: warning: already initialized constant INDEX
# passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v2.0.2.

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.
1
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... not found
 * Apache 2 development headers... not found
 * Apache Portable Runtime (APR) development headers... found
 * fastthread... found
 * rack... found

Some required software is not installed.
But don't worry, this installer will tell you how to install them.

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

                                                                                      • -
Installation instructions for required software * To install Apache 2: Please run yum install httpd as root. * To install Apache 2 development headers: Please run yum install httpd-devel as root. If the aforementioned instructions didn't solve your problem, then please take a look at the Users Guide: /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.2/doc/Users guide.html

で、環境変数を設定してから再チャレンジ。

# export APXS2=/usr/local/apache2/bin/apxs
# export PATH=/usr/local/apache2/bin:$PATH
# passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v2.0.2.

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.
1
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/apache2/bin/httpd
 * Apache 2 development headers... found at /usr/local/apache2/bin/apxs
 * Apache Portable Runtime (APR) development headers... found at /usr/local/apache2/bin/apr-1-config
 * fastthread... found
 * rack... found
                                                                                      • -
                                                                                      • -
Compiling and installing Apache 2 module... cd /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.2 rake clean apache2 (in /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.2) ### In ext/apache2: rm -rf Utils.o Bucket.o Logging.o System.o Configuration.o Hooks.o mod_passenger.o mod_passenger.so ApplicationPoolServerExecutable ### In ext/passenger: make clean rm -f Makefile ### In ext/boost/src: rm -f libboost_thread.a *.o ### In test: rm -f Apache2ModuleTests *.o ### In benchmark: rm -f DummyRequestHandler ApplicationPool ### In ext/boost/src: g++ -g -DPASSENGER_DEBUG -fPIC -I../.. -D_REENTRANT -DNDEBUG -c *.cpp g++ -g -DPASSENGER_DEBUG -fPIC -I../.. -D_REENTRANT -DNDEBUG -c pthread/exceptions.cpp g++ -g -DPASSENGER_DEBUG -fPIC -I../.. -D_REENTRANT -DNDEBUG -c pthread/thread.cpp g++ -g -DPASSENGER_DEBUG -fPIC -I../.. -D_REENTRANT -DNDEBUG -c pthread/once.cpp ar cru libboost_thread.a *.o ranlib libboost_thread.a ### In ext/apache2: g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/local/apache2/include -I/usr/local/apache2/include -D_REENTRANT -g -DPASSENGER_DEBUG -Wall -I/usr/local/include -c mod_passenger.c ### In ext/apache2: g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/local/apache2/include -I/usr/local/apache2/include -D_REENTRANT -g -DPASSENGER_DEBUG -Wall -I/usr/local/include -c Utils.cpp ### In ext/apache2: g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/local/apache2/include -I/usr/local/apache2/include -D_REENTRANT -g -DPASSENGER_DEBUG -Wall -I/usr/local/include -c Bucket.cpp ### In ext/apache2: g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/local/apache2/include -I/usr/local/apache2/include -D_REENTRANT -g -DPASSENGER_DEBUG -Wall -I/usr/local/include -c Logging.cpp ### In ext/apache2: g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/local/apache2/include -I/usr/local/apache2/include -D_REENTRANT -g -DPASSENGER_DEBUG -Wall -I/usr/local/include -c System.cpp ### In ext/apache2: g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/local/apache2/include -I/usr/local/apache2/include -D_REENTRANT -g -DPASSENGER_DEBUG -Wall -I/usr/local/include -c Configuration.cpp ### In ext/apache2: g++ -I.. -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/local/apache2/include -I/usr/local/apache2/include -D_REENTRANT -g -DPASSENGER_DEBUG -Wall -I/usr/local/include -c Hooks.cpp ### In ext/apache2: g++ -shared Utils.o Bucket.o Logging.o System.o Configuration.o Hooks.o mod_passenger.o -fPIC -o mod_passenger.so -lstdc++ -lpthread ../boost/src/libboost_thread.a -L/usr/local/apache2/lib -lapr-1 ### In ext/apache2: g++ ApplicationPoolServerExecutable.cpp System.o Utils.o Logging.o -o ApplicationPoolServerExecutable -I.. -D_REENTRANT -g -DPASSENGER_DEBUG -Wall -I/usr/local/include -DPASSENGER_DEBUG ../boost/src/libboost_thread.a -lpthread ### In ext/passenger: /usr/local/bin/ruby extconf.rb creating Makefile ### In ext/passenger: make gcc -I. -I/usr/local/lib/ruby/1.8/i686-linux -I/usr/local/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -c native_support.c gcc -shared -o native_support.so native_support.o -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic
                                                                                      • -
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.0.2/ext/apache2/mod_passenger.so PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.2 PassengerRuby /usr/local/bin/ruby 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 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.0.2/doc/Users guide.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.

上手くいきました :)。