首页 文章

让Rails 3和Passenger在CentOS 5.4上工作 - Apache错误

提问于
浏览
1

在CentOS 5.4上使用Ruby 1.8.7 . 试图让乘客获得Rails 3应用程序 .

我已完成所有步骤,但在我的Apache日志文件中出现此错误

Passenger ERROR (ext/common/ApplicationPool/../SpawnManager.h:220):
Could not start the spawn server: /usr/lib/ruby/: Permission denied (13)
[ pid=18207 thr=3086812880 file=ext/apache2/HelperAgent.cpp:354 time=2011-02-09 09:27:18.541 ]: Could not start the spawn server: write() failed: Broken pipe (32)
     in 'Passenger::SpawnManager::SpawnManager(const std::string&, const boost::shared_ptr<Passenger::ServerInstanceDir::Generation>&, const Passenger::AccountsDatabasePtr&, const std::string&, const Passenger::AnalyticsLoggerPtr&, int, const std::string&)' (SpawnManager.h:540)
     in 'Passenger::ApplicationPool::Pool::Pool(const std::string&, const boost::shared_ptr<Passenger::ServerInstanceDir::Generation>&, const Passenger::AccountsDatabasePtr&, const std::string&, const Passenger::AnalyticsLoggerPtr&, int, const std::string&)' (Pool.h:1078)
     in 'Server::Server(Passenger::FileDescriptor, pid_t, const std::string&, bool, const std::string&, const std::string&, const std::string&, const std::string&, unsigned int, unsigned int, unsigned int, unsigned int, const Passenger::VariantMap&)' (HelperAgent.cpp:241)
     in 'int main(int, char**)' (HelperAgent.cpp:344)

[Wed Feb 09 09:27:18 2011] [error]
Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Unable to start the Phusion Passenger helper agent: it seems to have crashed during startup for an unknown reason, with exit code 1
[Wed Feb 09 09:27:18 2011] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 09 09:27:18 2011] [notice] Digest: done
Passenger ERROR (ext/common/ApplicationPool/../SpawnManager.h:220):
Could not start the spawn server: /usr/lib/ruby/: Permission denied (13)
[ pid=18221 thr=3086513872 file=ext/apache2/HelperAgent.cpp:354 time=2011-02-09 09:27:18.592 ]: Could not start the spawn server: write() failed: Broken pipe (32)
     in 'Passenger::SpawnManager::SpawnManager(const std::string&, const boost::shared_ptr<Passenger::ServerInstanceDir::Generation>&, const Passenger::AccountsDatabasePtr&, const std::string&, const Passenger::AnalyticsLoggerPtr&, int, const std::string&)' (SpawnManager.h:540)
     in 'Passenger::ApplicationPool::Pool::Pool(const std::string&, const boost::shared_ptr<Passenger::ServerInstanceDir::Generation>&, const Passenger::AccountsDatabasePtr&, const std::string&, const Passenger::AnalyticsLoggerPtr&, int, const std::string&)' (Pool.h:1078)
     in 'Server::Server(Passenger::FileDescriptor, pid_t, const std::string&, bool, const std::string&, const std::string&, const std::string&, const std::string&, unsigned int, unsigned int, unsigned int, unsigned int, const Passenger::VariantMap&)' (HelperAgent.cpp:241)
     in 'int main(int, char**)' (HelperAgent.cpp:344)

不知道从哪里开始 . Ruby或我的应用程序的权限被拒绝?

独立模式的乘客给我一个关于无法加载Bundler的错误 .

真的想在Apache2下运行它 .

1 回答

  • 4

    Tyndall,看起来运行apache的用户没有权限

    Could not start the spawn server: /usr/lib/ruby/: Permission denied (13)
    

    尝试 su 给运行apache的用户,并尝试运行ruby或访问文件夹/ usr / lib / ruby

    编辑

    请尝试以下步骤检查apache是否具有权限 .

    • 登录unix服务器

    • [如果你不是root]通过运行 sudo su - 成为root

    • 检查哪个用户正在运行apache bye运行 ps -ef | grep -i apache (第一列应该显示用户名)

    • 现在通过运行 su apache - 变为apache(如果apache是用户名)

    • 现在运行 cd /usrlscd 检查文件夹的执行权限, ls 检查读取权限)

    • /usr/lib 之前的步骤相同 . 这是必要的,因为它可能是apache无法访问路径中的某个文件夹 .

    • 一旦你在 /use/lib 中通过运行 ls -l ruby 检查ruby的二进制文件是否存在

    • 终于尝试用 ./ruby -v 从该文件夹运行ruby(检查它是否返回正确的版本)

    如果所有这些都有效,请在此粘贴您为乘客提供的apache配置 .

    应该是这样的

    LoadModule passenger_module /usr/local/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
    PassengerRoot /usr/local/ruby/lib/ruby/gems/1.9.1/gems/passenger-3.0.2
    PassengerRuby /usr/local/ruby/bin/ruby
    PassengerDefaultUser www-data
    

相关问题