ホーム > 未分類 > 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 年 7 月 8 日 20:47 | #1

    I couldn’t refrain from commenting. Very well written!

  2. 2020 年 7 月 8 日 21:19 | #2
  3. 2020 年 7 月 8 日 21:35 | #3

    I really love your site.. Pleasant colors & theme. Did you develop this site yourself? Please reply back as I’m planning to create my very own blog and would love to find out where you got this from or what the theme is named. Cheers!

  4. 2020 年 7 月 8 日 21:50 | #4

    Oh my goodness! Impressive article dude! Thank you, However I am having troubles with your RSS. I don’t know why I am unable to subscribe to it. Is there anyone else having similar RSS problems? Anybody who knows the answer will you kindly respond? Thanx!!

  5. 2020 年 7 月 8 日 21:55 | #5

    Hi there! This post couldn’t be written much better! Reading through this article reminds me of my previous roommate! He constantly kept preaching about this. I will send this post to him. Fairly certain he will have a great read. Thank you for sharing!

  6. 2020 年 7 月 8 日 21:57 | #6

    Aw, this was an extremely good post. Finding the time and actual effort to create a great article… but what can I say… I procrastinate a whole lot and don’t manage to get nearly anything done.

  7. 2020 年 7 月 8 日 22:06 | #7

    You made some good points there. I looked on the internet to find out more about the issue and found most individuals will go along with your views on this site.

  8. 2020 年 7 月 8 日 22:13 | #8

    This site truly has all the info I wanted about this subject and didn’t know who to ask.

  9. 2020 年 7 月 8 日 22:27 | #9

    Saved as a favorite, I like your web site!

  10. 2020 年 7 月 8 日 22:27 | #10

    I want to to thank you for this wonderful read!! I certainly enjoyed every little bit of it. I’ve got you book-marked to look at new things you post…

  11. 2020 年 7 月 8 日 22:29 | #11

    Everyone loves it whenever people come together and share opinions. Great website, continue the good work!

  12. 2020 年 7 月 8 日 22:38 | #12

    http://www.nfl-jerseys.us.org/ Cheap NFL Jerseys

  13. 2020 年 7 月 8 日 22:51 | #13

    That is a great tip particularly to those fresh to the blogosphere. Brief but very precise information… Thanks for sharing this one. A must read article!

  14. 2020 年 7 月 8 日 23:25 | #14

    This is a very good tip especially to those new to the blogosphere. Short but very precise info… Appreciate your sharing this one. A must read post!

  15. 2020 年 7 月 8 日 23:42 | #15

    I blog frequently and I truly appreciate your information. The article has truly peaked my interest. I will book mark your website and keep checking for new information about once a week. I subscribed to your RSS feed as well.

  16. 2020 年 7 月 9 日 00:46 | #16

    A motivating discussion is worth comment. I do think that you need to publish more on this topic, it might not be a taboo matter but generally people don’t discuss these issues. To the next! Best wishes!!

  17. 2020 年 7 月 9 日 00:47 | #17

    This is a good tip especially to those fresh to the blogosphere. Short but very precise info… Thank you for sharing this one. A must read post!

  18. 2020 年 7 月 9 日 01:03 | #18

    I blog quite often and I really appreciate your content. This article has truly peaked my interest. I’m going to take a note of your site and keep checking for new information about once a week. I opted in for your RSS feed as well.

  19. 2020 年 7 月 9 日 01:06 | #19

    This blog was… how do you say it? Relevant!! Finally I’ve found something which helped me. Thanks a lot!

  20. 2020 年 7 月 9 日 01:17 | #20

    There’s definately a lot to find out about this issue. I really like all the points you’ve made.

  21. 2020 年 7 月 9 日 01:20 | #21

    I blog frequently and I genuinely appreciate your information. This great article has really peaked my interest. I will bookmark your site and keep checking for new information about once a week. I subscribed to your RSS feed too.

  22. 2020 年 7 月 9 日 01:37 | #22
  23. 2020 年 7 月 9 日 01:37 | #23

    Very good article. I definitely appreciate this website. Thanks!

  24. 2020 年 7 月 9 日 01:40 | #24

    This is the perfect blog for everyone who would like to understand this topic. You understand a whole lot its almost hard to argue with you (not that I really will need to…HaHa). You definitely put a fresh spin on a subject that has been discussed for decades. Excellent stuff, just great!

  25. 2020 年 7 月 9 日 01:45 | #25

    This web site really has all of the information and facts I needed about this subject and didn’t know who to ask.

  26. 2020 年 7 月 9 日 01:49 | #26

    Great article! We are linking to this great article on our website. Keep up the good writing.

  27. 2020 年 7 月 9 日 02:34 | #27
  28. 2020 年 7 月 9 日 02:57 | #28

    I’m amazed, I have to admit. Seldom do I encounter a blog that’s both equally educative and interesting, and let me tell you, you’ve hit the nail on the head. The problem is something which too few men and women are speaking intelligently about. I’m very happy I came across this in my hunt for something relating to this.

  29. 2020 年 7 月 9 日 03:12 | #29

    I would like to thank you for the efforts you have put in penning this website. I am hoping to view the same high-grade content from you in the future as well. In fact, your creative writing abilities has inspired me to get my own site now ;)

  30. 2020 年 7 月 9 日 03:12 | #30

    I seriously love your blog.. Pleasant colors & theme. Did you develop this web site yourself? Please reply back as I’m planning to create my own site and would love to find out where you got this from or exactly what the theme is named. Thank you!

  31. 2020 年 7 月 9 日 03:31 | #31

    Howdy, There’s no doubt that your website could possibly be having web browser compatibility problems. Whenever I look at your blog in Safari, it looks fine but when opening in I.E., it’s got some overlapping issues. I just wanted to provide you with a quick heads up! Aside from that, excellent website!

  32. 2020 年 7 月 9 日 04:47 | #32
コメントページ
1 151 152 153 19
  1. 2020 年 4 月 14 日 16:04 | #1
  2. 2020 年 4 月 16 日 16:14 | #2
  3. 2020 年 4 月 20 日 03:03 | #3
  4. 2020 年 4 月 25 日 13:09 | #4
  5. 2020 年 4 月 26 日 09:02 | #5
  6. 2020 年 4 月 30 日 20:59 | #6
  7. 2020 年 5 月 8 日 23:33 | #7
  8. 2020 年 5 月 10 日 04:08 | #8
  9. 2020 年 6 月 22 日 19:25 | #9
  10. 2020 年 7 月 1 日 23:36 | #10