From 9e5a43ee9a10e307e5a204746cda5c2171c4b6f3 Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 19 Nov 2026 20:56:16 +0100 Subject: [PATCH] install_httpd-2.4.sh: logrotate - keep Nextcloud log writable for the web user. The generated /etc/logrotate.d/apache2 rotates /var/www/*/logs/*log with 'create 644 root adm'. For Nextcloud's cloud.log this left a root-owned file after rotation, so Nextcloud could no longer write its log. Chown cloud.log to the web user in postrotate, as already done for php_errors.log. Co-Authored-By: Claude Opus 5.5 --- install_httpd-2.4.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install_httpd-2.4.sh b/install_httpd-2.4.sh index c6b1e91..732273d 100755 --- a/install_httpd-2.4.sh +++ b/install_httpd-2.4.sh @@ -4896,6 +4896,11 @@ if [ ! -f "/etc/logrotate.d/apache2" ]; then if ls /var/www/*/logs/php_errors.log > /dev/null 2>&1 ; then chown ${HTTPD_USER}:${HTTPD_GROUP} /var/www/*/logs/php_errors.log fi + # Nextcloud writes its log as ${HTTPD_USER} + if ls /var/www/*/logs/cloud.log > /dev/null 2>&1 ; then + chown ${HTTPD_USER}:${HTTPD_GROUP} /var/www/*/logs/cloud.log + chmod 640 /var/www/*/logs/cloud.log + fi if [ -f "/var/log/apache2/php_errors.log" ] ; then chown ${HTTPD_USER}:${HTTPD_GROUP} /var/log/apache2/php_errors.log fi