Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 May 2000 19:45:20 +0200
From:      Marc Silver <marcs@draenor.org>
To:        Andy Coates <andy@friends-tv.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Quota and Apache Logs Puzzle
Message-ID:  <20000527194520.T2219@draenor.org>
In-Reply-To: <00df01bfc801$8e3e8e10$0100a8c0@blade>; from andy@friends-tv.net on Sat, May 27, 2000 at 06:30:46PM %2B0100
References:  <00df01bfc801$8e3e8e10$0100a8c0@blade>

next in thread | previous in thread | raw e-mail | index | archive | help
Simple.  (or at least I think so).

Simply create the directory as root.  Leave the permissions as 
owned by root, and the group wheel.  Then, you'll want to enable sticky
bit on the directory itself.  

To do this:

chmod 1777 <logdir>

You'll then have a directory that is the equivalent of /tmp, from which
users can write to and delete, but cannot remove the directory or files
that belong to another user.  You'll have to make sure though that the
actual log file is owned by the user in the logfile directory.

This *should* be a near-perfect solution.

Good luck,
Cheers,
Marc


On Sat, May 27, 2000 at 06:30:46PM +0100, Andy Coates wrote:
> Hi,
> 
> I've decided to setup apache to store logfiles in the user's own directory,
> say ~user/logs. I also want to make those logfiles part of the users quota.
> 
> Here comes the bit thats stumped me... if I create a virtual host for the
> user, and I don't create the log directory, apache won't start because the
> log directory doesn't exist. If I do create the log directory (as root), the
> normal ownerships for the directory are user root group <user>, which the
> user can delete, hence if done apache wouldn't start. So if I make ownership
> root/wheel, the user can't delete it and apache will be fine as the
> directory will always be there. But.... then the log files will be the
> ownership of root and won't count in the quota.
> 
> Its fried my brain trying to work out the right method for this, so I'm
> writing this to see if anyone out there can help me out with the situation -
> either correcting where I went wrong or maybe suggesting an alternative.
> 
> TIA,
> Andy.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000527194520.T2219>