How to rotate logs in Apache HTTPD using logrotate and rotatelogs ?

Solution Verified - Updated -

Issue

  • Different ways to rotate apache logs -- rotatelogs (built into apache) or logrotate (linux). Which method to use?
  • Does logrotate stop Apache or cause any issues to end users?
  • How to rotate access.log using size based?
  • How to achieve access log rotation?
  • How to autorotate EWS logs?

Environment

  • Red Hat Enterprise Linux (RHEL)
    • 7.x,8.x,9.x
  • Red Hat Software Collections (RHSCL)
    • httpd-2.4.x
  • Red Hat JBoss Core Services (JBCS) Apache httpd
    • 2.4
  • Apache Web Server (httpd)
    • 2.2.x
    • 2.4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content