Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just set up rails on an apache server running on Ubuntu, and when I try to go to the root page it gives this error:

An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger.

bash: Permission denied

env and all the directories in the path all have permissions 755. I tried setting env to have permissions 777 but still got the same error. Rails is running as "nobody". Why is this happening? I don't know what else to try.

In /etc/apache2/sites-available/api.conf:

<VirtualHost *:80>
  DocumentRoot /var/www/api/public
  ErrorLog /var/www/logs/error.log
  CustomLog /var/www/logs/access.log combined
  RailsSpawnMethod smart
  <Directory /var/www/api/public>
    # This relaxes Apache security settings.
    AllowOverride all
    # MultiViews must be turned off.
    Options -MultiViews -Indexes
    # Uncomment this if you're on Apache >= 2.4:
    Order allow,deny
    Allow from all
    #Require all granted

From config/database.yml in my rails directory (with sensitive user names and passwords omitted):

default: &default
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: root
  socket: /var/run/mysqld/mysqld.sock

  <<: *default
  database: api_development

  <<: *default
  database: api_test

  <<: *default
  url: <%= ENV['DATABASE_URL'] %>
  database: api
  username: ------------
  password: ------------

Not sure what other details or files are relevant, I will add them if needed.

share|improve this question
Is it trying to read it/write it or execute the /usr/bin/env??? – mdpc Jun 7 '14 at 2:42
I don't know, but it doesn't work even with full permissions granted on that file to everybody. – Eric Hopkins Jun 7 '14 at 14:14

Check AppArmor for a failure, but it looks as though Apache is trying to execute the file and failing.

The config doesn't seem right... take a look at Passenger or Unicorn.

share|improve this answer
I'm not familiar with AppArmor, where should I check for the failure? I looked through all the config files in use BTW and none of them mention /usr, /usr/bin or /usr/bin/env. And I'm using passenger 4.0.4. – Eric Hopkins Jun 7 '14 at 14:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.