Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-05-10, 05:16:11

Author Topic: logrotate for httpd does not work properly  (Read 4703 times)

0 Members and 1 Guest are viewing this topic.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
logrotate for httpd does not work properly
« on: 2016-05-15, 22:59:42 »
It removes all logs. To bring them back I need to restart httpd.

Quote
/home/httpd/*/stats/*_log {
    daily
    rotate 30
    #create 0664 apache apache
    compress
    notifempty
    missingok
}

/home/*/__processed_stats/*_log {
    daily
    rotate 30
    #create 0750 root root
    compress
    notifempty
    missingok
}

Same for qmail and it's maillog ;(

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: logrotate for httpd does not work properly
« Reply #1 on: 2016-05-16, 01:23:35 »
I am not sure, try without 'compress'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: logrotate for httpd does not work properly
« Reply #2 on: 2016-05-16, 22:52:42 »
I will check it out

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: logrotate for httpd does not work properly
« Reply #3 on: 2016-05-18, 11:44:15 »
Does not work ;(

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: logrotate for httpd does not work properly
« Reply #4 on: 2016-05-18, 11:54:30 »
There should be something like this:

        postrotate
            /etc/init.d/httpd reload > /dev/null
        endscript

See: https://serversforhackers.com/managing-logs-with-logrotate

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: logrotate for httpd does not work properly
« Reply #5 on: 2016-05-18, 12:00:03 »
There should be something like this:

        postrotate
            /etc/init.d/httpd reload > /dev/null
        endscript

See: https://serversforhackers.com/managing-logs-with-logrotate
So, what's  about og using other webserver because '/etc/init.d/httpd reload' only for apache.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: logrotate for httpd does not work properly
« Reply #6 on: 2016-05-18, 12:41:29 »
Try change content of /etc/logrotate.d/kloxo with:
Code: [Select]
#
# Kloxo LogRotate
# Initial version
# Needs cleanup
# Using this one on LxCenter server
# Created by Danny Terweij <d.terweij@lxcenter.org>
#
# Daily rotates (compressed) and keeps maximum of 30 days
#
# add and modified by Mustafa Ramadhan <mustafa.ramadhan@lxcenter.org>

/home/httpd/*/stats/*_log
/home/*/__processed_stats/*_log
/usr/local/lxlabs/kloxo/log/*
{
    daily
    rotate 30
    #create 0664 apache apache
    compress
    notifempty
    missingok
    sharedscripts
    postrotate
        sh /scripr/restart-web -y >/dev/null 2>&1 || true
        sh /scripr/restart -y >/dev/null 2>&1 || true
    endscript
}
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: logrotate for httpd does not work properly
« Reply #7 on: 2016-05-18, 17:17:33 »
OK

Offline yazarweb

  • Junior Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: logrotate for httpd does not work properly
« Reply #8 on: 2016-08-10, 21:56:18 »
Hi;

rotate 730     I want to record log 2 years

Is it below as appropriate ?


/home/httpd/*/stats/*_log
/home/*/__processed_stats/*_log
/usr/local/lxlabs/kloxo/log/*
{
    daily
    rotate 730
    #create 0664 apache apache
    compress
    notifempty
    missingok
    sharedscripts
    postrotate
        sh /scripr/restart-web -y >/dev/null 2>&1 || true
        sh /scripr/restart -y >/dev/null 2>&1 || true
    endscript
}
« Last Edit: 2016-08-10, 22:21:11 by yazarweb »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: logrotate for httpd does not work properly
« Reply #9 on: 2016-08-11, 02:30:13 »
It's ' rotate 730' or ' rotate 30'?. Kloxo-MR 7.0 using ' rotate 30' (rotate everry 30 days).
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.037 seconds with 22 queries.

web stats analysis