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

My django app saves images and they're being saved as nobody:nobody instead of www-data: like they previously were under a different server. nginx is setup as user www-data and I ran the runfcgi as root so permission shouldn't be an issue.

share|improve this question
up vote 1 down vote accepted

Check ps waux. My suspicion is that your runfcgi has dropped privileges to a different user to make sure that you are not running scripts as root - a very dangerous thing to do.

If that is the case, the solution is as simple as editing the configuration for however you are managing your fcgi instances and having it use www-data:www-data as the user and group that it drops privileges to instead of nobody.

share|improve this answer
I'm running them through the django manage command. If I run it as ubuntu it does the same thing. – Ryan Detzel Mar 3 '11 at 18:59

Running django in fastcgi must be stopped and started by user code, if you call ./ runfcgi your user will own the process. If you are running this from a startup job root will own the process, which is bad because files and logs it writes will not be accessible to other users and processes and leaves no permissions sandbox for you app. Best practice is to launch your app with the same user as apache or the other apps that need to share files with it. If your app needs to be launched from a startup script (root context)

sudo -u youruser runfcgi

to avoid your app running as root.

You mentioned the user 'nobody' - this is the default user nginx saves files as. I suggest you make nginx use the same user as your app, your can do this by adding

user youruser;

in nginx.conf

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.