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

Here's my situation: what i want to do is to "git clone" a project under /var/www. But since i'm logged into my server as idcuser selinux (I suppose :D) doesn't permit me to do it.

How can I "give" permission to my user to write under /var/www and, in the same time, let apache continue to read/write the files "cloned".

Thanks a lot!

share|improve this question

closed as not a real question by Michael Hampton, Scott Pack, mdpc, HopelessN00b, Magellan Nov 20 '12 at 23:54

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

What does this have to do with SELinux? – Michael Hampton Nov 20 '12 at 15:04
up vote 0 down vote accepted

Use extended acl for you file system. First chown to www-data/httpd for your entire folder. After use setfacl to add extended acl to the same folder:

setfacl -m u:your_user:rwx -R folder

I presume you are using ext3/4 and you already have all compiled in your kernel (older versions of kernel 2.6 didn't had acl support enabled).

If you get: setfacl: folder: Operation not supported

then you should remount the partition with acl support:

mount -oremount,defaults,acl /parition

and don't forget to add it to fstab for later use.

Remember, for any new file added you should do the same steps: 1. chown www-data 2. setfacl

share|improve this answer
thanks. this seems to solve my very first problem! – dop3 Nov 20 '12 at 11:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.