Set default owner/user

Posted by Daniel Hollands on Ask Ubuntu See other posts from Ask Ubuntu or by Daniel Hollands
Published on 2011-11-16T12:57:54Z Indexed on 2011/11/17 2:05 UTC
Read the original article Hit count: 305

Filed under:

I'm a web developer, and so have set-up an old machine in the office as an Ubuntu Server, for the purposes of testing websites.

I've set-up LAMP and have created a /var/www folder, from which all my local sites are served. The issue is that of user permissions, i.e. any files that I copy into that folder (from my Windows machine via the network) automatically take on me (daniel) as their owner. The problem is that I want www-data to become the owner.

I did some research and saw that it should be possible to use setuid (and setgid) to automatically set www-data as the owner of all files put into /var/www automatically, so far I've not had any luck making it work.

Can someone help please? Thank you

UPDATE: Would this do what I want it to do? Default file permissions for php user www-data

UPDATE 2: I've kinda fixed my issue by changing my samba settings. Using Webmin, I was able to go in and change the default settings (as seen here: http://imageshack.us/photo/my-images/521/captureon.png/)

© Ask Ubuntu or respective owner

Related posts about permissions