5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Apacheでログローテート

Last updated at Posted at 2016-03-02

例 ) 過去3日のログを残しあとは自然にローテート(削除)する。

/etc/logrotate.d/httpd
/var/log/httpd/*log {
    daily  [追記]
    rotate 3  [追記]
    missingok
    notifempty
    sharedscripts
    delaycompress
    postrotate
        /etc/init.d/httpd reload > /dev/null 2>/dev/null || true
    endscript
}

この設定により

ログの肥大化を防ぎ、いちいちログを削除する手間が省ける。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?