简体   繁体   中英

Run Rails with Passenger on Apache with Plesk

I have everything installed as per this tutorial: https://www.digitalocean.com/community/tutorials/how-to-setup-a-rails-4-app-with-apache-and-passenger-on-centos-6

But when I go to the website, I get an error, and in the error log it shows this:

[ 2015-02-26 16:17:47.3041 28207/7f7326058780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Thu Feb 26 16:17:47.305819 2015] [mpm_prefork:notice] [pid 28184] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 Phusion_Passenger/4.0.59 mod_perl/2.0.9-dev Perl/v5.16.3 configured -- resuming normal operations
[Thu Feb 26 16:17:47.305844 2015] [core:notice] [pid 28184] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[ 2015-02-26 16:22:04.7157 28225/7f2c65840840 apache2/Hooks.cpp:151 ]: A filesystem exception occured.
  Message: Cannot stat '/var/www/vhosts/blah.blah/httpdocs/config.ru
  Backtrace:
     in 'void Passenger::DirectoryMapper::autoDetect()' (DirectoryMapper.h:144)
     in 'bool Hooks::prepareRequest(request_rec*, Passenger::DirConfig*, const char*, bool)' (Hooks.cpp:374)

Can anyone help?

The config.ru file was auto generated by rails, and it has these lines:

# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment',  __FILE__)
run BlahBlah::Application

Your problem can be related to the following things:

  • config.ru file is not exists by the specified path

    Try to execute command for check this:

     ls -la /var/www/vhosts/blah.blah/httpdocs/config.ru 
  • Passenger doesn't have permissions to read this file

    Try to execute command for check this:

     namei -lm /var/www/vhosts/blah.blah/httpdocs/config.ru 

PS I noticed you are using shared hosting. Don't use them if you want to avoid a lot of different problems. Use VPS servers instead. Like Digital Ocean or Linode for Rails applications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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