I have an old server running online with over 250 sites on it I am not sure, but maybe too many logfiles in the apachelog are slowing down the server?
Now since I don't need the Apache logs, How do I disable all logging completely?
I disabled all vhosts logging with:
find /etc/apache2/sites-enabled/* -exec sed -i 's/#*[Cc]ustom[Ll]og/#CustomLog/g' {} \;
find /etc/apache2/sites-enabled/* -exec sed -i 's/#*[Ee]rror[Ll]og/#ErrorLog/g' {} \;
and commented out in /etc/apache2/apache2.conf
#ErrorLog ${APACHE_LOG_DIR}/error.log
and added
ErrorLog /dev/null
Restart apache gracefully:
apache2ctl graceful
I have a lot of logs in different places so I can watch the result with
tail -n 1 -f /var/kunden/logs/*log /var/kunden/logs/*log /var/log/apache2/*log
If you want to enable all logging into one file you can edit /etc/apache2/apache2.conf
again and add those lines:
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log "%h %v %l %u %t \"%r\" %>s %b"
and comment out
#ErrorLog /dev/null
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加