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

FileUtils.copy('/tmp/p15s3pt9sm1303tmj1brh1n14dtg8.jpg','/nginx/main/')

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?

link|improve this question
Might SELinux be restricting the copy for the nginx user? – hwilbanks Apr 1 '11 at 22:43
feedback

1 Answer

up vote 0 down vote accepted

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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