ホーム > 未分類 > Passenger(mod_rails for Apache)を試す

Passenger(mod_rails for Apache)を試す

Passenger(mod_rails for Apache)をインストールしてみました。
試した環境は

  • MaxOSX Tiger
  • Apache2.2(MacPortsでインストール済み)

です。

apacheが複数インストールされている場合は対象のApache apxsを指定する必要があるようです。

> export APXS2=/opt/local/apache2/bin/apxs

まずgemでインストールして、

> sudo gem install passenger -y

mod_railsをインストール。

> sudo passenger-install-apache2-module

ありゃ。

### In ext/apache2:
g++ -flat_namespace -bundle -undefined dynamic_lookup Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o -fPIC -o mod_passenger.so   -lstdc++ -lpthread ../boost/src/libboost_thread.a -L/opt/local/lib -lapr-1
/usr/bin/ld: flag: -undefined dynamic_lookup can't be used with MACOSX_DEPLOYMENT_TARGET environment variable set to: 10.1
collect2: ld returned 1 exit status
rake aborted!
Command failed with status (1): [g++ -flat_namespace -bundle -undefined dyn...]
/opt/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/rakefile:132
(See full trace by running task with --trace)

明らかに怪しいので MACOSX_DEPLOYMENT_TARGET を設定してリトライ。

> export MACOSX_DEPLOYMENT_TARGET=10.4
> sudo passenger-install-apache2-module

とおった。

The Apache 2 module was successfully installed.

以下のように表示されるので、httpd.confに設定を追加。

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

LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so
RailsSpawnServer /opt/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
RailsRuby /opt/local/bin/ruby

VirtualHostの設定でrailsアプリケーションの位置を指定。

<VirtualHost *:80>
        ServerName test.hoge.com
        DocumentRoot /path/to/rails/public
</VirtualHost>

apacheを再起動。

> apachectl configtest
> sudo apachectl restart

無事動作しました。
mod_rails(passenger)はmogrelの3倍メモリを食う? らしいですが、どちらを使おうか。

ちなみにapacheを再起動することなく、railsアプリケーションを再読み込みしたい場合はrailsアプリのtmpディレクトリに restart.txt を置けば(または更新すれば)よいとのこと。ふむ。
Passenger users guide

カテゴリー: 未分類 タグ: , ,
  1. 2020 年 4 月 1 日 04:09 | #3

    I’m very pleased to find this website. I need to to thank you for ones time due to this wonderful read!! I definitely loved every bit of it and i also have you book marked to look at new stuff on your blog.

  2. 2020 年 4 月 1 日 06:40 | #6

    You ought to take part in a contest for one of the greatest websites on the net. I will recommend this web site!

  3. 2020 年 4 月 1 日 07:20 | #7

    I’m impressed, I must say. Rarely do I encounter a blog that’s both equally educative and interesting, and without a doubt, you’ve hit the nail on the head. The issue is something that too few men and women are speaking intelligently about. Now i’m very happy I stumbled across this during my hunt for something regarding this.

  4. 2020 年 4 月 1 日 07:51 | #10

    You have made some good points there. I looked on the web for additional information about the issue and found most individuals will go along with your views on this website.

  5. 2020 年 4 月 1 日 08:17 | #13

    I’m excited to uncover this site. I need to to thank you for ones time for this particularly wonderful read!! I definitely loved every bit of it and I have you bookmarked to check out new stuff on your site.

  6. 2020 年 4 月 1 日 08:38 | #15

    Greetings! Very helpful advice within this article! It’s the little changes that produce the most significant changes. Thanks for sharing!

  7. 2020 年 4 月 1 日 15:19 | #18

    I blog frequently and I really appreciate your information. This great article has really peaked my interest. I am going to bookmark your website and keep checking for new details about once per week. I subscribed to your Feed as well.

  8. 2020 年 4 月 1 日 16:02 | #19

    You need to take part in a contest for one of the finest websites on the net. I’m going to highly recommend this website!

  9. 2020 年 4 月 1 日 16:27 | #20
  10. 2020 年 4 月 1 日 18:12 | #22

    Aw, this was an extremely good post. Taking a few minutes and actual effort to create a very good article… but what can I say… I hesitate a whole lot and never seem to get nearly anything done.

  11. 2020 年 4 月 1 日 18:56 | #23

    Very good info. Lucky me I found your blog by accident (stumbleupon). I have saved as a favorite for later!

  12. 2020 年 4 月 1 日 21:06 | #24

    Pretty! This was a really wonderful article. Thank you for providing this information.

  13. 2020 年 4 月 1 日 21:56 | #25

    I could not resist commenting. Well written!

  14. 2020 年 4 月 2 日 00:41 | #28

    When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I get four emails with the same comment. Is there a way you can remove me from that service? Thanks!

  15. 2020 年 4 月 2 日 01:28 | #29

    Howdy! This post could not be written any better! Looking at this article reminds me of my previous roommate! He always kept preaching about this. I’ll forward this post to him. Pretty sure he’ll have a very good read. Thank you for sharing!

  16. 2020 年 4 月 2 日 03:48 | #30

    Excellent article. I’m going through a few of these issues as well..

  17. 2020 年 4 月 2 日 04:33 | #31

    I could not resist commenting. Exceptionally well written!

  18. 2020 年 4 月 2 日 07:03 | #34

    When I originally commented I seem to have clicked the -Notify me when new comments are added- checkbox and now whenever a comment is added I get 4 emails with the same comment. Perhaps there is a means you are able to remove me from that service? Thanks a lot!

  19. 2020 年 4 月 2 日 07:47 | #35

    Your style is unique compared to other people I’ve read stuff from. Thanks for posting when you have the opportunity, Guess I will just book mark this page.

  20. 2020 年 4 月 2 日 08:19 | #37

    Very good write-up. I certainly love this website. Thanks!

  21. 2020 年 4 月 2 日 08:21 | #38
  22. 2020 年 4 月 2 日 08:48 | #41

    Excellent web site you’ve got here.. It’s difficult to find excellent writing like yours nowadays. I seriously appreciate individuals like you! Take care!!

  23. 2020 年 4 月 2 日 09:09 | #42

    Greetings! Very helpful advice within this post! It’s the little changes that produce the largest changes. Many thanks for sharing!

  24. 2020 年 4 月 2 日 10:23 | #46

    You have made some decent points there. I checked on the internet to find out more about the issue and found most people will go along with your views on this web site.

  25. 2020 年 4 月 2 日 14:10 | #47

    Pretty! This has been an incredibly wonderful article. Thank you for supplying these details.

  26. 2020 年 4 月 2 日 14:56 | #48

    Spot on with this write-up, I really feel this site needs a lot more attention. I’ll probably be returning to read more, thanks for the information!

コメントページ
1 19 20 21 19
  1. トラックバックはまだありません。