LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting group automatically upon file creation (local web development configuration) (https://www.linuxquestions.org/questions/linux-newbie-8/setting-group-automatically-upon-file-creation-local-web-development-configuration-288857/)

jht2k 02-11-2005 05:35 AM

Setting group automatically upon file creation (local web development configuration)
 
Hi,

I'm in the process of setting up my Ubuntu box with a web development configuration that will allow me to edit web sites under my local non-root account (jonathan), while also allowing the local Apache server (www-data) to access, and maybe modify, these sites.

The sites are hosted in a subdirectory within my home directory, and for each website I set up a soft link from /var/www/<sitename> to this directory so that I can keep track of the sites on the machine.

I've set up a new group called web on the machine, and added the users jonathan and www-data to this group. The directory for each website will have read/write access for jonathan (for the purpose of editing the site), and read access for the web group with write access where applicable (so that Apache can serve it). Therefore, my web apps won't scrub the entire site in the event of anything going wrong.

The main problem I'm having here is that I'm not sure how to get the system to automatically set newly created files to group "web", as opposed to group "jonathan". Further to this, it would be nice if the system could set the group to "jonathan" upon file creation outside my website directories, and "web" when inside my website directories.

I'd also like any feedback if possible on my overall approach to this - hence the hefty amount of background info!

Cheers

Jon

theYinYeti 02-11-2005 06:05 AM

See if that helps:

chgrp web /path/to/web/dir
chmod g+s /path/to/web/dir

Yves.


All times are GMT -5. The time now is 10:40 AM.