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 <noreply@anthropic.com>
This commit is contained in:
1 parent
75fb321cc0
commit
9e5a43ee9a
1 file changed
+5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user