elanbeat's wiki
LighttpdLogRotation

lighttpdのlogrotate設定

以下、ディレクトリ構成などはFedoraを想定。

/etc/lighttpd/lighttpd.conf中でserver.pid-fileの設定がされていることを確認。


## to help the rc.scripts
server.pid-file             = "/var/run/lighttpd.pid" 

/etc/logrotate.d/httpdを参考に/etc/logrotate.d/lighttpdを作成。ログのファイル名を変更している場合などは適宜合わせる。


/var/log/lighttpd/*log { missingok notifempty sharedscripts postrotate /bin/kill -HUP `cat /var/run/lighttpd.pid 2>/dev/null` 2> /dev/null || true endscript
}