0

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.

/usr/bin/env: 
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>
  ServerName api.thinknation.ca
  ServerAlias api.thinknation.ca
  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
  </Directory>
</VirtualHost>

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
  password:
  socket: /var/run/mysqld/mysqld.sock

development:
  <<: *default
  database: api_development

test:
  <<: *default
  database: api_test

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

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

1 Answers1

0

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.

MikeyB
  • 39,291
  • 10
  • 105
  • 189
  • 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 07 '14 at 14:49