Score:1

How do I limit the number of apache log files

sa flag

I am using Ubunto 2018.4 VPS and using phpfpm 7.2-4. I have about 30 domains and each domain creates log files and archives them. It currently creates about 15 of each type (access/log) so there are literally hundreds of logs to sift through every time I need to.

So, my question is, is there a way to limit the number of archives that are saved from 3 max?

Many thanks PS: I am not an advanced user so some linux talk will go right over my head, thanks again.

cn flag
The archiving of the log files is probably not done by the Apache httpd server itself, but by a separate tool like [logrotate](https://linux.die.net/man/8/logrotate). You may want to look into your configuration of logrotate (or whatever similar tool you're using). There you can define which logfiles to rotate, when to rotate them, how many archived files to keep and so forth.
sa flag
Thanks @Henning Kockerbeck i will look into it. I found it. It was in logrotate.d > apache file and set at 14. Thanks
cn flag
Sounds great! I've elaborated a bit on my comment in an answer. Maybe you could accept the answer as correct.
Score:1
cn flag

The logs aren't archived, or rotated, by the Apache HTTPd server itself, but by a separate tool called logrotate. Logrotate takes care of most logs. In addition to logs written by daemons like Apache HTTPd, MySQL or Postfix, it also rotates system logs like syslog, auth.log and so forth.

You may want to look into your logrotate configuration in /etc/logrotate.conf (the central config) and the files in /etc/logrotate.d (separate files for different logs). There you can configure which logfiles should be rotated, when to rotate them, how many archived files to keep and so forth.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.