Moin,

Eike Bernhardt wrote:
> On Wed Apr 14 01:40:37 1999 CEST Knut Grahlmann wrote:
> 
> > Ich lasse logresolve per cronjob meine httpd.access DNS-aufloesen.
> > Ich starte es etwa 15min bevor ich vom webalizer Statistiken anfertigen
> > lasse.
> > Nun ist das Problem, dass die 15 min einfach nicht genug sind,
> > logresolve nicht fertig wird und webalizer unvollstaendige Ergebnisse
> > liefert (z.B. mehrere Tage weglaesst).
> > [blubber]
> W�sst ich jetzt nicht, aber du k�nntest z.B. Apache sagen, das er seine
> Logfiles immer nach einem Monat neu beginnen soll indem du als Filename
> zum Loggen z.b. "/var/log/httpd.access_log`date +%m-%y`" angibst, dann
> muss logresolve immer nur den Datenbestand eines Monats durchackern.

Herzlichen Dank Eike, hat mir sehr stark geholfen.

Also habe da ein bisschen rumgespielt und dabei ist folgendes
rausgekommen:
Sowie ich es sehe, kann man in /etc/httpd/httpd.conf unter CustomLog das
o.g nicht direkt eintragen.
ABER: Gegen einen symbolischen Link hat Apache nichts, also habe ich das
dort gemacht (httpd.access_log.actual).
Nun wird am Monatsanfang das folgende Script ausgefuehrt:
---------------------------------------------------------
#!/bin/bash
# written 04/15/1999 by Knut Grahlmann <[EMAIL PROTECTED]>

# creates monthly a new log-file for apache and notifies root of the
change
# (for use with crontab, see man crontab and man 5 crontab)

# I dunno why apache needs to be restarted after that, guess it has
something to do with the symbolic
# link

# limitations: non-SuSE users probably need to modify the paths

touch /var/log/httpd.access_log_`date +%m_%y`
chgrp bin /var/log/httpd.access_log_`date +%m_%y`
chmod 0600 /var/log/httpd.access_log_`date +%m_%y`
rm /var/log/httpd.access_log.actual
ln -s /var/log/httpd.access_log_`date +%m_%y`
/var/log/httpd.access_log.actual
echo "changed apache log files at `date`"|mail root
/sbin/init.d/apache stop 1>/dev/null
/sbin/init.d/apache start 1>/dev/null
----------------------------------------------------------

In /etc/crontab steht nun folgendes:
1 0 1 * * root /root/apache_log_change
(Koennte natuerlich REIN theoretisch das Problem geben, dass wenn zu dem
Zeitpunkt ein http-zugriff stattfindet, die Datei vielleicht "gelocked"
ist.)


Have phun

Knut

-- 
Knut Grahlmann

registered Linux User #88582
http://205.222.185.29
--
Um aus der Liste ausgetragen zu werden, eine Mail an [EMAIL PROTECTED]
schicken, mit dem Text: unsubscribe suse-linux

Antwort per Email an