【问题标题】:Incomplete response received from application Rails 4 Passenger error从应用程序 Rails 4 乘客错误收到的不完整响应
【发布时间】:2016-06-09 12:46:19
【问题描述】:

我有一个 Rails 4.2.6 应用程序,在 Ubuntu 14.04 x64 上安装了 Passenger 5.0.28。

使用 Capistrano 成功部署后,我无法打开网站。而且我什至找不到表明问题的日志文件。经过一番研究,我发现最常见的问题是缺少secret_key_base env var。

这是我非常简单的 apache 配置文件:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName my.server.com
        DocumentRoot /var/www/my_server/current/public
    PassengerRuby /home/deployer/.rvm/gems/ruby-2.2.2/wrappers/ruby
        <Directory />
                Options FollowSymLinks
                AllowOverride None
                RailsEnv staging_v4
        </Directory>
        <Directory /var/www/my_server/current/public/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                Allow from all
        Require all granted
        </Directory>
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error-v4.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access-v4.log combined
</VirtualHost>

当我尝试打开我的应用程序时看到错误: 收到的申请回复不完整

日志tail -f /var/log/apache2/*

==> /var/log/apache2/access-v4.log <==
10.0.14.224 - - [09/Jun/2016:18:47:22 +0600] "GET / HTTP/1.1" 502 343 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.63 Safari/537.36"
10.0.14.224 - - [09/Jun/2016:18:47:23 +0600] "GET /favicon.ico HTTP/1.1" 200 1449 "http:/my.server.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.63 Safari/537.36"

错误日志为空。

我的应用程序登录 /var/www/my_server/current/log 也是空的

所以到目前为止我做了什么:

  • 我将实际字符串放入 /var/www/my_server/current/config/secrets.yml
  • 我在 /etc/profile、/home/deployer/.bash_profile、/etc/apache2/envvars 中添加了 export SECRET_KET_BASE=&lt;string&gt;

有什么想法吗?我应该在哪里从服务器收集更多信息?

【问题讨论】:

    标签: ruby-on-rails apache passenger


    【解决方案1】:

    我在 Rails 5.2、apache、passenger 上有类似的问题

    解决方案是将此行放在配置文件中(conifg/initializers)

    Rack::Utils.multipart_part_limit = 0
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-28
      • 2015-08-22
      • 2021-04-09
      • 2018-12-03
      • 1970-01-01
      • 2019-12-04
      • 2021-12-05
      • 1970-01-01
      相关资源
      最近更新 更多