Debian – permissions for multiple users in apache

apache-2.2debianfile-permissions

I am trying to setup permissions for a directory in my apache2. I am going to show a scenario so its easier to explain and understand:

This is my directory listing with permissions

 -> root:root drwxr-x--x www
      -> gasim:www-data drwxr-x--- mydomain.com
           -> drwxr-x--- gasim:www-data www
           -> drwxr-x--- gasim:www-data dev
      ... some other folders here

I am using a framework where I need to use www-data as a group because there are some write permissions etc.

I want to make the directory 'dev' have read/write permission by a group mydomain-dev
How should I approach this but still keep the group www-data. I don't want to add the user to the group www-data because it will have access to other domain folders. Maybe this approach it self is wrong. If it is, whats a better way to approach this situation

Hope i made sense.

Best Answer

You can add an extra vhost for this folder and run it with a different user:

For Linux: http://mpm-itk.sesse.net/

For (Open)Solaris: http://httpd.apache.org/docs/2.4/mod/mod_privileges.html