[Nottingham] Apache Questions + Logwatch

Graeme Fowler graeme at graemef.net
Fri Nov 11 16:36:16 GMT 2005


On Fri 11 Nov 2005 16:04:54 GMT , Michael Erskine <msemtd at yahoo.co.uk> wrote:
>> First up, I'm serving pages from user-dirs on apache , ie out of
>> /home/<username>/public_html. What would I add to the conf file to access
>> the pages through www.site.com/<username> as well as
>> www.site.com/~<username>?
>
> mod_rewrite?

http://httpd.apache.org/docs/1.3/mod/mod_userdir.html

Hint: UserDir /home/*/public_html

>> Second, I am running apache with suexec, and I'd like to have some stats as
>> to how much time various scripts take and who ran them. I've look at
>> process accounting (gnu acct), but it only seems to work for users who log
>> on with a shell and run commands, not for commands su'd to users. Any
>> ideas?
>
> No, sorry Mike, none here (_had_ to respond even if no info: got flamed last
> time I didn't answer EVERY SINGLE QUESTION IN MY RESPONSE, RELEVANT OR
> NOT :) )

Oooh, tetchy ;-)

I'm not 100% sure you can do this in the way you think, although some 
of the extended Apache logging attributes might help you out a bit.

http://httpd.apache.org/docs/1.3/mod/mod_log_config.html#formats

You could try having a CustomLog directive dumping stuff into a "page 
runtime" logfile using a format something like:

LogFormat "%v %h %l %u %t \"%r\" %>s %b %T %{USERNAME}e" 
vhost_scriptuserdetails
CustomLog /path/to/logfile vhost_scriptuserdetails

You'd then need to post-process the logfile at intervals to find your 
info. That suggestion is not one I've tried, so YMWV :)

>> Lastly, logwatch:
>> the email I get from logwatch seem to be truncated after a certain number
>> of lines. Any ideas how to stop this, or is it nothing to do with logwatch
>> and everything to do with something else. </signal>
>
> Again, not using it but perhaps due to log actually being truncated: 
> logrotate technique used for those tailing an inode rather than a 
> filename.

/etc/log.d/logwatch.conf

Do you want to change "Detail"?

Graeme





More information about the Nottingham mailing list