How to disable or turn off the Apache Server ( httpd ) access log, error log options to optimize speed


Amongst any Hyper Text Transfer Protocol Daemon (i.e. web server or simple httpd), the Apache HTTP Server is the most used because of its simplicity, reliability and feedback options (available on the owners forum). It is also available in packs like the Wamp Server, packs that install Apache, PHP, mysql32 on Windows.

Apache logging capabilities allow webmaster to effectively manage a web server, analyze traffic statistics, and troubleshooting the errors that may occurred. This troubleshooting often occurs via the error log or any other log available. But error logs can sometime become a double edge sword.

Some users choose not to keep the Apache logs because they can grow in very big sizes and also the Apache servers runs faster without logs enabled.

Apache tricks : how to disable error and access logs

In order to turn of and disable Apache logging options, follow the simple steps bellow:

1. Go to the Apache configuration file, httpd.conf, which normally is located in one of the following folders:

  • /etc/httpd/conf

  • /etc/apache/conf,

  • /etc/apache2/conf,

  • usrlocalapacheconf

  • usrlocalapache2conf

2. The logging is defined by a CustomLog directive for access logs and an ErrorLog directive for error logs. For example:

  • CustomLog: /usr/local/apache/logs/access_log common

  • ErrorLog : “logs/error_log”

3. To disable logging of access log, comment the line of CustomeLog, by adding # in the front of the line.

4. To disable logging of error log, comment the line of ErrorLog, by adding # in the front of the line.

5. Restart the Apache web server for the change to take effect.

Tags: apache, error, server, logs, logging, disable, line, access, errorlog, available, options, because, troubleshooting, etcapacheconf, directive, customlog, also, usrlocalapacheconf, packs, turn, adding, front, httpd, simple, comment, order, tricks, follow, bellow, configuration