<br><div class="gmail_quote">On Wed, May 4, 2011 at 7:38 PM, Gordon Messmer <span dir="ltr"><<a href="mailto:yinyang@eburg.com">yinyang@eburg.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 05/04/2011 12:49 PM, Johan Martinez wrote:<br>
</div><div class="im">> Thanks for the suggestions Richard and Kenneth. I installed drupal here<br>
> and it requires user running apache to have write access on filesystem.<br>
> Otherwise it complains: 'The directory sites/default/files is not<br>
> writable'. The content editors/developers need write access to<br>
> theme/pictures folders. So it seems like I can't avoid giving write<br>
> access to apache user. Any hacks or tips here?<br>
<br>
</div>Tip 1:<br>
Your files and directories can have different permissions.  Rather than<br>
your original setup, try:<br>
<div class="im"><br>
chown -R apache:contenteditors /var/www/html<br>
</div>find /var/www/html -type f -exec chmod 0464 {} +<br>
find /var/www/html -type d -exec chmod 2575 {} +<br>
<br>
or:<br>
<br>
chown -R apache:apache /var/www/html<br>
find /var/www/html -type f -exec setfacl -m g:contenteditors:rw {} +<br>
find /var/www/html -type d -exec setfacl -m g:contenteditors:rwx {} +<br>
<br>
Tip 2:<br>
Don't install drupal in /var/www/html.  Generally, /var/www/html should<br>
be used only for static content.  Web applications should be installed<br>
outside the document root to prevent a misconfiguration from allowing<br>
remote clients from downloading files that might contain configurations,<br>
passwords, or other sensitive information.  See the rpm packaged drupal<br>
for an example of how this is done.<br>
<br>
Tip 3:<br>
If your application says that it needs write access to<br>
"sites/default/files", then add write access only for that directory.<br>
<div><div></div><div class="h5">_______________________________________________<br>
CentOS mailing list<br>
<a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
<a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
</div></div></blockquote></div><br><div><br></div><div>Thanks for the suggestions everyone. I am using following config for now. </div><div><br></div><div>* Moved drupal install outside document root and used alias for the namespace mapping. </div>
<div>* Filesystem ownership: apache:contenteditors</div><div>* Filesystem permissions: u=rx, g=rwx, group with sticky bit set. Exception of 'sites/default/files' on which apache has write permissions. </div><div><br>
</div><div>jM</div>