Change logrotation file.

This commit is contained in:
Christoph 2017-10-18 14:55:51 +02:00
parent 9dbc786c44
commit ff6074b088
2 changed files with 22 additions and 6 deletions

View File

@ -583,11 +583,19 @@ if [ ! -f "/etc/logrotate.d/apache2" ]; then
create 644 root adm
sharedscripts
postrotate
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
if [[ -f "/var/log/apache2/php_errors.log" ]] ; then
chown ${HTTPD_USER}:${HTTPD_GROUP} /var/log/apache2/php_errors.log
fi
APACHECTL="\$(which apachectl)"
if [[ -z "\$APACHECTL" ]] ; then
echo "Prog 'apachectl' not found!"
if [[ -f "/etc/init.d/apache2" ]; then
/etc/init.d/apache2 reload > /dev/null
else
echo "Reloading apache service failed!"
fi
else
\$APACHECTL graceful > /dev/null
fi

View File

@ -3580,11 +3580,19 @@ if [ ! -f "/etc/logrotate.d/apache2" ]; then
create 644 root adm
sharedscripts
postrotate
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
if [[ -f "/var/log/apache2/php_errors.log" ]] ; then
chown ${HTTPD_USER}:${HTTPD_GROUP} /var/log/apache2/php_errors.log
fi
APACHECTL="\$(which apachectl)"
if [[ -z "\$APACHECTL" ]] ; then
echo "Prog 'apachectl' not found!"
if [[ -f "/etc/init.d/apache2" ]; then
/etc/init.d/apache2 reload > /dev/null
else
echo "Reloading apache service failed!"
fi
else
\$APACHECTL graceful > /dev/null
fi