<div class="gmail_quote">On Mon, Aug 17, 2009 at 12:00 PM, Alexander Kraev <span dir="ltr"><<a href="mailto:alexander.kraev@gmail.com">alexander.kraev@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
It depends on web-server architecture and how many sites you are going<br>
to run inside /var/www.<br>
<br>
root:root is good for /var/www if you are running many sites in<br>
/var/www. Let's say:<br>
<br>
/var/www/<a href="http://example.org" target="_blank">example.org</a><br>
/var/www/<a href="http://example.net" target="_blank">example.net</a><br>
/var/www/<a href="http://sub.example.org" target="_blank">sub.example.org</a><br>
<br>
Each of these directory has to be owned as www-data:www-data if you use<br>
only www-data user to manage all virtual hosts and unix_user:www-data in<br>
case of multi-user virtual host based web server.<br>
<br>
It's a quick tip, all depends on your needs and web server's architecture.<br></blockquote><div><br> "Each of these directory has to be owned as www-data:www-data"<br><br>This is absolutely not true, and a bad idea for reasons already pointed out in this thread (Roy Sigurd Karlsbakk's email). Only set www-data as the owner when a web application specifically calls for it and only on the folder or file that it calls for.<br>
<br>For instance, say a web application requires the web server to have write access to /var/www/myapp/uploads/. Then keep /var/www owned by root.root and perms set to 755, and change just the uploads folder to be owned by www-data.root (or www-data.www-data, or root.www-data with 775 perms, it's all the same).<br>
<br>If you do want users without root privileges to be able to modify the directories, then that is ok give them permissions to write to whatever they need, but you do not want to give www-data any more than read permissions unless your web application specifically calls for it.<br>
<br>Brazen<br></div></div>