write permission for www-data

Jim Ohlstein jim at ohlste.in
Wed Jul 27 14:19:20 UTC 2011


On 7/27/11 9:50 AM, etrader wrote:
> Thanks folks. Let me conclude that it is better to keep the owner of my
> folders to be "root". Then give permission to www-data (nginx user) for
> every writable folder like upload and images? right?
> 
> My main question is about the folder ownership; which is better? root or
> www-data? 
> Because when I normally create folder by SSH or SSH tunnel to server, I
> am there as root and create folder with root ownership.

This is really off the topic of this list. However the answer to your
question is it's a matter of choice.

You can create the directory as root and change the ownership with
"chown", you can create the directory using "sudo -u www-data mkdir" or
you can leave the ownership as root and use "chmod".


> 
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,213004,213010#msg-213010
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


-- 
Jim Ohlstein



More information about the nginx mailing list