G0574's Archiver

弯月圆刀 发表于 2008-10-29 15:39

mod_rails passenger启动出错

Error message:
No such file or directory - /nonexistent

Exception class:
Errno::ENOENT

原来 PassengerDefaultUser 是nobody,在我的机器上这个用户的目录是/nonexistent,所以出现问题也就很正常了。

将PassengerDefaultUser设置成其他用户即可。

弯月圆刀 发表于 2008-10-29 15:48

更加详细的说明:
passenger是根据config/environment.rb这个文件的owner来决定采用哪个用户来运行。如果 config/environment.rb的主人是www,那么就已www运行。

但是passenger永远也不会以root身份运行,如果它发现 config/environment.rb的主人是root,就会用PassengerDefaultUser的值来替代。


所以楼上的解决方法不好,正确的解决是将config/environment.rb的owner改变一下即可。
8.1. User switching (security)

There is a problem that plagues most PHP web host, namely the fact that all PHP applications are run in the same user context as the web server. So for example, Joe's PHP application will be able to read Jane's PHP application's passwords. This is obviously undesirable on many servers.

Phusion Passenger solves this problem by implementing user switching. A Rails application is started as the owner of the file config/environment.rb, and a Rack application is started as the owner of the file config.ru. So if /home/webapps/foo/config/environment.rb is owned by joe, then Phusion Passenger will launch the corresponding Rails application as joe as well.

This behavior is the default, and you don't need to configure anything. But there are things that you should keep in mind:

    *

      The owner of environment.rb must have read access to the Rails application's folder, and read/write access to the Rails application's logs folder. Likewise, the owner of config.ru must have read access to the Rack application's folder.
    *

      This feature is only available if Apache is started by root. This is the case on most Apache installations.
    *

      Under no circumstances will applications be run as root. If environment.rb/config.ru is owned as root or by an unknown user, then the Rails/Rack application will run as the user specified by PassengerDefaultUser.

User switching can be disabled with the PassengerUserSwitching option.

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.