LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2005, 05:35 AM   #1
jht2k
LQ Newbie
 
Registered: Aug 2004
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 0
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
 
Old 02-11-2005, 06:05 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
See if that helps:

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

Yves.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
default group on file creation antony.booth Linux - Security 3 08-24-2007 06:36 AM
correct setting of /etc/apt/sources.list for local file pascalv Linux - Software 4 07-15-2005 09:24 AM
Setting group on file creation/edit deiussum Linux - Security 4 06-17-2005 04:50 PM
Automatically Setting File Permissions in a Directory maneeshsethi Linux - Security 2 05-27-2004 07:42 PM
Setting up a Web Development Server w/ Slackware Lohan Slackware 5 01-25-2004 01:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration