Date: Thu, 3 Oct 2002 07:56:03 +0000 From: Jez Hancock <jez.hancock@munk.nu> To: FreeBSD ISP List <freebsd-isp@FreeBSD.ORG> Subject: Re: Apache vhost directive problem Message-ID: <20021003075602.GA57985@users.munk.nu> In-Reply-To: <20021003093609.I96307-100000@cox.rosnet.ru> References: <20021003043348.GA55962@users.munk.nu> <20021003093609.I96307-100000@cox.rosnet.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Oct 03, 2002 at 09:38:13AM +0400, Konstantin M Volevatch wrote:
> On Thu, 3 Oct 2002, Jez Hancock wrote:
>
> > Date: Thu, 3 Oct 2002 04:33:48 +0000
> > From: Jez Hancock <jez.hancock@munk.nu>
> > To: FreeBSD ISP List <freebsd-isp@FreeBSD.ORG>
> > Subject: Apache vhost directive problem
> >
> > Hi folks,
> >
> > I have a problem with my apache httpd vhost configuration.
> >
> > My vhost entries for numerous users look like this:
> >
> > <VirtualHost *>
> > ServerName eggshell.munk.nu
> > ServerAdmin support@munk.nu
> > DocumentRoot /home/eggshell/web
> > ErrorLog /home/eggshell/logs/httpd-error.log
> > CustomLog /home/eggshell/logs/httpd-access.log combined
> > </VirtualHost>
> >
> > and the problem I'm having is that if a user removes either their logs
> > or web dir, the server will not (re)start correctly since the vhost
> > configuration is broken after such changes.
>
> Use 'apachectl configtest' before restart
> Also, you may set 'sunlnk' flag on 'web' subdir
Nice one, I'll have a read of man chflags, could be the command I need
to run on a few items when creating user's home dirs (I'm also trying to
stop user's from being able to modify their .history files if anyone can
point me in right direction).
What I have so far is this (perl script):
sub createUser{
# $user is passed in to this func:
my $user=shift;
my $pw_cmd="$pw adduser -n $user -m";
#exec cmd (password is returned, but this depends on
#pw.conf(5) 'defaultpasswd' setting:
my $pass=&doCmd($pw_cmd); # doCmd just execs the command passed to it
# is this safe to get at password this way?
chomp($pass);
# chown the logs dir as well to stop users from
# deleting it:
my $cmd="chown www /home/$user/logs && chmod 755 /home/$user/logs";
&doCmd($cmd);
return($pass);
}
Any hints/tips would be much appreciated (or any full blown scripts I
could take a look at:).
Cheers again,
Jez
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021003075602.GA57985>
