Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

passengerを使うとApache環境下でRailsが動く

passengerというgemをつかうと、Apache環境でもRailsが動きます。
Rackやnginx、UnicornじゃなくてもRailsって動くんですね(今更

さて、これには、apacheと連携して使う

$ passenger-install-apache2-module

というコマンドがついています。
実行したら実際礼儀正しい案内に従っておけば、
必要な事項をガイドしてくれるスグレモノ。
UNIX哲学的には過剰な出力に相当するのかもしれませんけど...。

具体的には、

Warning: some directories may be inaccessible by the web server!

The web server typically runs under a separate user account for security
reasons. That user must be able to access the Phusion Passenger files.
However, it appears that some directories have too strict permissions. This
may prevent the web server user from accessing Phusion Passenger files.

It is recommended that you relax permissions as follows:

  sudo chmod o+x "/root"

Press Ctrl-C to return to the shell. (Recommended)
After relaxing permissions, re-run this installer.
  -OR-
Press Enter to continue anyway.

てな感じで権限設定の仕方まで指示してくれます。