RE: giving users their own http logs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
>
> Ed Wilts <mailto:ewilts@xxxxxxxxxx>
>     on Friday, January 09, 2004 11:41 AM said:
>
> > I've got this included in my VirtualHost directive and it's working
> > fine (other non-relevant parts were snipped):
>
> [snip]
>
> > I then have a webalizer directive that processes these logs and throws
> > the output back into a subdirectory of the DocumentRoot.  This
> > approach seems to work fine for me.
>
> Thanks for response Ed but I'm not using virtual hosts (right now at
> least). How should I change your example to work with what I'm doing
> now?
>
> http://domain.com/~username/
>
> I want all activity within ~username/ to be logged. Does this make a big
> difference?
>
>
>

Since virtualhosts are not involved, i would probably end up writing my own
script for it.  Writing the script would be fairly simple (esp. if you are
familiar with the grep command) depending on your requirements.  How do you
want to provide the logs?
1) keep the original log intact and provide copies to the users with only
their relevant entries?
2) do not keep the original log, i don't need it, and provide the users with
only their relevant entries
3) provide the logs in real time
4) provide the logs on a daily basis (e.g. the most recent log entries I
will give them will be yesterday's so as not to disrupt apache's current
logging for today)

Anyway, with grep you could do something like:

grep "GET \"http://domain.name/~username/"; $APACHE/logs/access_log >
~username/access_log

You would pull out the usernames for your script using:

awk -F: '{print $1}' /etc/passwd | tail +somenumber

(where somenumber is set to where your first userid's are so that you don't
bother grepping logfiles for your system accounts)


Alternatively you could probably write a much cleaner (and more thorough and
less resource intensive ) script in Perl.  If you need more pointers on this
let me know

Just throwing the idea out there for you
Good luck-

Ben Y








-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux