Commit 262bfeff authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Configured logrotate to rotate httpd logs once per week

parent 82a7e950
all: httpd-service
all: httpd-service httpd-logrotate
rm /etc/passwd
mv -v /data/etc/passwd /etc/passwd
rm /etc/group
......@@ -38,6 +38,7 @@ all: httpd-service
sed '/^# DirectoryIndex:/,/^# The following/{/^# The following/!d}' -i /etc/httpd/httpd.conf
@echo "IncludeOptional conf/*.conf" >> /etc/httpd/httpd.conf
@echo "d /run/httpd 755 root root -" > /usr/lib/tmpfiles.d/httpd.conf
@echo "$$HTTPD_LOGROTATE" > /etc/logrotate.d/httpd
@echo "$$HTTPD_SERVICE" > /lib/systemd/system/httpd.service
systemctl enable httpd.service
rm -rf httpd-2.4.39
......@@ -62,3 +63,29 @@ LimitNOFILE=infinity
WantedBy=multi-user.target
endef
export HTTPD_SERVICE
httpd-logrotate:
define HTTPD_LOGROTATE
/var/log/httpd/*access_log {
weekly
rotate 3
missingok
sharedscripts
compress
postrotate
/bin/kill -USR1 `cat /run/httpd/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
/var/log/httpd/*error_log {
weekly
rotate 3
missingok
sharedscripts
compress
postrotate
/bin/kill -USR1 `cat /run/httpd/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
endef
export HTTPD_LOGROTATE
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment