Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Is it trying to read it/write it or execute the /usr/bin/env??? –  mdpc Jun 7 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 at 14:14

1 Answer 1

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 at 14:49

Your Answer

 
discard

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.