Kelvin
Kelvin

Reputation: 123

Rails passenger /tmp/ folder permission denied

Afternoon all,

Attempting to get my Rails app working on a Mac Apache MySql Ruby setup and a passenger directory. When I try and access it through the web front eend I get the following error.

*** Exception Errno::EACCES in spawn manager (Permission denied - /tmp/passenger.1.0.54375/generation-0/spawn-server/socket.54643.70317578161560) (process 54643, thread #<Thread:0x007fe82c0519c0>):

Apache config for this vhost looks like this

<VirtualHost *:80>
  ServerName test.me
  DocumentRoot /Users/me/Projects/app/public
  <Directory /Users/me/Projects/app/public>
     AllowOverride all
     Options -MultiViews
  </Directory>

Can anyone see what I am missing? FWIW the folder it tries to access is owned by root which seems a bit odd

drwsr-xr-x   3 root        wheel   102 11 Oct 15:25 passenger.1.0.54375

Upvotes: 2

Views: 7203

Answers (1)

iliis
iliis

Reputation: 996

Passenger assumes the owner of config/environement.rb (see http://www.modrails.com/documentation/Security%20of%20user%20switching%20support.html, restart apache/passenger for changes to take effect) and this user needs write and execute rights for tmp.

So, find out who owns config/environement.rb:

$> ls -lah config/environment.rb 
-rwxr-xr-x 1 www-data www-data 152 Jan 22 07:53 config/environment.rb

I choose www-data here, as this is the user my apache uses. I don't reccomend root.

$> chown www-data:www-data config/environment.rb

Giving this user full access to the tmp folder and its contents should be sufficient:

$> chmod -R 700 tmp

Upvotes: 3

Related Questions