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 have centos CENTOS 5.5 x86_64. apache 2.2 nginx/0.8.54 rails 3 ruby 1.8 passenger Its cpanel. What I am trying to accomplish is to upload an image to /tmp and then move it to the doc root of the nginx server. There will be many images and I want them to be outside of the rails application. I have accomplished this with no problem on ubuntu but I can't use ubuntu in production.

on the rails console logged in as a non root user I can do this


but this same code in the rails app produces Errno::EACCES (Permission denied - /nginx/main/p15s9i103q19331cob1oap1l8hvoae.jpg)

I have tried just about everything I could think of to do with symlinks, I have tried just put the permissions wide open. I changed the owner and group nobody.

Does anyone know what my problem is? And how to work around it?

share|improve this question
Might SELinux be restricting the copy for the nginx user? – hwilbanks Apr 1 '11 at 22:43
up vote 0 down vote accepted

After reviewing the Phusion Passenger documentation, I see that passenger runs the rails app as the owner of This was set to nobody. I changed the owner to the cpanel user and this fixed my problem

share|improve this answer

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.