1
votes

I have a Rails 4.2.6 application with Passenger 5.0.28 on Ubuntu 14.04 x64.

After successful deployment using Capistrano, I can't open website. And I even can't find log files that will indicate the problem. After some research, I have found out that the most common problem is missing secret_key_base env var.

So here is my pretty simple apache config file:

<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>

When I try to open my app In see the error: Incomplete response received from application

Logs 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"

Error log is empty.

My application logs in /var/www/my_server/current/log also empty

So what I did so far:

  • I put actual string inside /var/www/my_server/current/config/secrets.yml
  • I added export SECRET_KET_BASE=<string> inside /etc/profile, /home/deployer/.bash_profile, /etc/apache2/envvars

Any thoughts? Where should I gather more information from server?

1

1 Answers

0
votes

I have similar issue on Rails 5.2, apache, passenger

The solution was to put this line in the configuration files (conifg/initializers)

Rack::Utils.multipart_part_limit = 0