Ads by Google
街に待った。。 Passenger ( Mod_rails For Apache ) !!
嬉しいので早速インストールをしてみることに。
とりあえず仮想マシンで最小限構成のマシンを構築する。OSはFedoara
必要なCGIなどをインストール。ImageMagickなどもついでにいれてしまう。
yum install ruby ruby-devel rubygems ImageMagick ImageMagick-devel ruby-mysql httpd
つづいてGemで必要にパッケージのインストール。
gem install rails -y
gem install passenger
↓ログ
[root@mod_rails_test /]# gem install rails -y
Successfully installed rails-2.0.2
Successfully installed rake-0.8.1
Successfully installed activesupport-2.0.2
Successfully installed activerecord-2.0.2
Successfully installed actionpack-2.0.2
Successfully installed actionmailer-2.0.2
Successfully installed activeresource-2.0.2
Installing ri documentation for rake-0.8.1...
Installing ri documentation for activesupport-2.0.2...
Installing ri documentation for activerecord-2.0.2...
Installing ri documentation for actionpack-2.0.2...
Installing ri documentation for actionmailer-2.0.2...
Installing ri documentation for activeresource-2.0.2...
Installing RDoc documentation for rake-0.8.1...
Installing RDoc documentation for activesupport-2.0.2...
Installing RDoc documentation for activerecord-2.0.2...
Installing RDoc documentation for actionpack-2.0.2...
Installing RDoc documentation for actionmailer-2.0.2...
Installing RDoc documentation for activeresource-2.0.2...
[root@mod_rails_test /]# gem install passenger
Install required dependency fastthread? [Yn] Y
Select which gem to install for your platform (i386-linux)
1. fastthread 1.0.1 (mswin32)
2. fastthread 1.0.1 (ruby)
3. Skip this gem
4. Cancel installation
> 2
Building native extensions. This could take a while...
Install required dependency rspec? [Yn] Y
Building native extensions. This could take a while...
Successfully installed passenger-1.0.1
Successfully installed fastthread-1.0.1
Successfully installed rspec-1.1.3
Installing ri documentation for passenger-1.0.1...
Installing ri documentation for fastthread-1.0.1...
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 ri documentation for rspec-1.1.3...
Installing RDoc documentation for passenger-1.0.1...
Installing RDoc documentation for fastthread-1.0.1...
No definition for dummy_dump
No definition for dummy_dump
No definition for rb_queue_marshal_load
No definition for rb_queue_marshal_dump
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:25: warning: already initialized constant FONTS
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:235: warning: already initialized constant STYLE
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:246: warning: already initialized constant XHTML_PREAMBLE
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:289: warning: already initialized constant HEADER
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:310: warning: already initialized constant FOOTER
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:335: warning: already initialized constant FILE_PAGE
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:384: warning: already initialized constant CLASS_PAGE
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:604: warning: already initialized constant METHOD_LIST
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:621: warning: already initialized constant BODY
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:640: warning: already initialized constant SRC_PAGE
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:649: warning: already initialized constant FR_INDEX_BODY
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:675: warning: already initialized constant FILE_INDEX
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:677: warning: already initialized constant CLASS_INDEX
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:678: warning: already initialized constant METHOD_INDEX
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:704: warning: already initialized constant INDEX
Installing RDoc documentation for rspec-1.1.3...
[root@mod_rails /]#
インストールガイドに沿って以下のコマンドを実行。
passenger-install-apache2-module
すると、、
[root@mod_rails /]# passenger-install-apache2-module
Welcome to the Passenger Apache 2 module installer.
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/httpd
* Apache 2 development headers... not found
* Apache Portable Runtime (APR) development headers... not found
* fastthread... 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 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.
[root@mod_rails /]#
ご丁寧にちゃんとYUMコマンドで出してくれる。
なんで指示通り、パッケージ追加する。
yum install httpd-devel apr-devel
パッケージのインストールが終わった以下のコマンドを実行。
passenger-install-apache2-module
[root@mod_rails /]# passenger-install-apache2-module
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Welcome to the Passenger Apache 2 module installer.
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/httpd
* Apache 2 development headers... found at /usr/sbin/apxs
* Apache Portable Runtime (APR) development headers... found
* fastthread... found
--------------------------------------------
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
--------------------------------------------
Compiling and installing Apache 2 module...
cd /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1
rake clean apache2
(in /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
### In ext/apache2:
rm -rf Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o mod_passenger.so
rm -r pkg
### 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
### In ext/boost/src:
g++ -O2 -fPIC -I../.. -D_REENTRANT -DNDEBUG -c *.cpp
ar cru libboost_thread.a *.o
ranlib libboost_thread.a
### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -I.. -c mod_passenger.c
### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -I.. -c Utils.cpp
### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -I.. -c Logging.cpp
### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -I.. -c Configuration.cpp
### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -I.. -c Hooks.cpp
### In ext/apache2:
g++ -shared Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o -fPIC -o mod_passenger.so -lstdc++ -lpthread ../boost/src/libboost_thread.a -laprutil-1 -lldap -llber -ldb-4.3 -lexpat -lapr-1 -luuid -lcrypt -lpthread -ldl
/usr/bin/ld: cannot find -luuid
collect2: ld returned 1 exit status
rake aborted!
Command failed with status (1): [g++ -shared Utils.o Logging.o Configuratio...]
/usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/Rakefile:132
(See full trace by running task with --trace)
--------------------------------------------
It looks like something went wrong
Please read our Users guide for troubleshooting tips:
/usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/doc/Users guide.html
If that doesn't help, please use our support facilities at:
http://www.modrails.com/
We'll do our best to help you.
んーエラーが起きる。。どうやらlibuuidがないらしい。
yumで入れてみて再度試してみるがどうも動かない。。
libフォルダを見ると、なぜかlibuuid.so.1ってなってる。なに。.1ってなんだよ。。
とりあえずシンボリックを貼ってみる。
ln -s /lib/libuuid.so.1 /lib/libuuid.so
再度、passenger-install-apache2-moduleを実行!
今度はうまくいきました。
--------------------------------------------
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-1.0.1/ext/apache2/mod_passenger.so
RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
RailsRuby /usr/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:
<VirtualHost *:80>
ServerName www.yourhost.com
DocumentRoot /somewhere/public
</VirtualHost>
And that's it! You may also want to check the Users Guide for security and
optimization tips and other useful information:
/usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/doc/Users guide.html
Enjoy Passenger, a product of Phusion (www.phusion.nl) :-)
http://www.modrails.com/
指示通りApache設定ファルイに以下の3行を追加〜
/etc/httpd/conf/httpd.conf
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so
RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
RailsRuby /usr/bin/ruby
んでバーチャルホストに設定。ポート880
Listen *:880
<VirtualHost *:80>
ServerName rails_app
DocumentRoot /var/www/html/rails_app/public
</VirtualHost>
Apache再起動
/etc/init.d/httpd restart
ブラウザで確認
無事動いてました!
途中 uuidライブラリで少し時間とられたけど、他はわりとスムーズ。
Passenger素敵です。。
■ RubyOnRails & Flash ActionScript 連携 RubyAMF導入メモ
http://adalberyo.blog116.fc2.com/blog-entry-119.html
■ 専用サーバーでRubyOnRails & Passenger環境構築メモ
http://adalberyo.blog116.fc2.com/blog-entry-106.html
コメント
コメントの投稿
トラックバック
プロフィール
Author:liao
海とか山とか川とか酒とか好きです。
リンク
全記事表示リンク
カレンダー
| 日 | 月 | 火 | 水 | 木 | 金 | 土 |
|---|---|---|---|---|---|---|
| - | - | - | 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | - |
ブログ内検索
最近の記事
- 【Javascriptをスクラッチから書いてみる】 eventの発生元のオブジェクトを取得する (01/27)
- VIMでFLASH(ActionScript3) (01/26)
- Trace Route 検証 (01/15)
- サクラインターネット(共有サーバー)でRAILS LIGHT (11/18)
- RubyAMF And Flash 8 Memo (11/12)
- Prel メール 文字コード変更方法 MINE Encodeモジュール (11/07)
- MYSQL バックアップ オフラインバックアップ手法 (11/06)
- Flash Rubyamd 間での日付の受け渡し時に、文字列から日付クラスに変換する (Flash8) (11/06)
- Ruby XML (11/05)
- Apache SSL設定例 メモ (11/03)
- WEBサーバーの情報を非表示。 (10/30)
- JD Rubyのインスートル (10/16)
- JQuery Validateを試してみる。 (10/08)
- RMagcik リサイズされない。 ImageMagickコンパイルエラー (10/02)
- Apache2 CGIの設定 画面が真っ白 (泣) (09/29)
- Ruby On Rails 2.1.1 環境構築ガイド 〜 ImageMagick Passenger RMagick 〜 (09/24)
- Google Chrome ゲット (09/02)
- みんなで凹んで慰めあう。。 リグレト (09/01)
- 素敵な友達達。。 (08/27)
- 夏だ!海だ!西伊豆だ! ダイビング 田子 (08/26)
最近のコメント
- kuma:西の魔女が死んだ (07/18)
- インディ:西の魔女が死んだ (07/16)
- kuma:バーベキューだっ 温泉だっ ホタルだっ 寿司が。。 (06/26)
- sanae:バーベキューだっ 温泉だっ ホタルだっ 寿司が。。 (06/25)
- ベトナム大好き:あふりかー (05/31)
- :撮影現場 (05/29)
- sanae:撮影現場 (05/28)
最近のトラックバック
カテゴリー
- 未分類 (63)
- WEBデザイン (6)
- お酒・食べ物 (7)
- システム開発 (15)
- 旅行・登山・温泉 (10)
- イベント (4)
- 書籍・音楽 (0)
- FLASH (2)
- Ruby (1)
- ネットワーク (1)
- Javascript (1)
検索フォーム
ブロとも一覧

■ ブログ名:25歳♀、インディになる!
ブロとも申請フォーム
QRコード

最近聴いた読んだ書籍&音楽










