简体   繁体   English

Passenger,Nginx和Capistrano - 乘客根本没有启动Rails应用程序

[英]Passenger, Nginx, and Capistrano - Passenger not launching Rails app at all

Essentially, my route is working perfectly, Passenger seems to be loading - all is hunky-dory. 从本质上讲,我的路线运作完美,乘客似乎正在装载 - 所有都是笨拙的。 Except that nothing Railsy happens. 除了没有Railsy发生。 Here's my Nginx log from starting the server to the first request (ignore the different domain/route - it's because I haven't moved the new domain over yet, and it's returning a 403 error because there's no index file in the public folder): 这是从启动服务器到第一个请求的我的Nginx日志(忽略不同的域/路由 - 这是因为我还没有移动新域,并且它返回403错误,因为公共文件夹中没有索引文件):

[ pid=24559 file=ext/nginx/HelperServer.cpp:826 time=2009-11-10 00:49:13.227 ]:
  Passenger helper server started on PID 24559
[ pid=24559 file=ext/nginx/HelperServer.cpp:831 time=2009-11-10 00:49:13.227 ]:
  Password received.
2009/11/10 00:49:53 [error] 24578#0: *1 directory index of "/var/www/***/current/public/" is forbidden, client: 188.221.195.27, server: ***, request: "GET / HTTP/1.1", host: "***"
2009/11/10 00:49:54 [error] 24578#0: *1 open() "/var/www/***/current/public/favicon.ico" failed (2: No such file or directory), client: 188.221.195.27, server: ***, request: "GET /favicon.ico HTTP/1.1", host: "***", referrer: "***"

Someone on the RubyOnRails IRC channel suggested that it might be a webserver permissions problem. RubyOnRails IRC频道上的某人建议它可能是网络服务器权限问题。 I had a suspicion that it might be a filesystem permission problem, but then Nginx runs as www-data and Passenger as root. 我怀疑它可能是文件系统权限问题,但随后Nginx以root身份运行为www-data和Passenger。

I can load static files from within the public directory fine, but no Rails application is being launched. 我可以从公共目录中加载静态文件,但是没有启动任何Rails应用程序。 Does anyone have an idea? 有没有人有想法? My head is gradually melting away figuring this one out! 我的头逐渐消失,想出这一个!

Edit: Here's the vhost file: 编辑:这是vhost文件:

server {
        listen       80;
        server_name  ***;
        passenger_enabled on;

        location / {
            root   /var/www/***/current/public;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

Problem solved, I am a spanner. 问题解决了,我是一个扳手。

I had 'passenger_enabled on;' 我有'乘客开机了'; inside 'location /' not 'server'. 在'location /'里面'不是'服务器'。 I hereby hand in my coding hands. 我亲自递交编码手。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM