Contents
What do you need to know about Apache error log?
The ErrorLogFormat directive specifies the format of the error log. On most Linux distributions, the Apache server is using the default format, which is sufficient for most cases. The logging behavior and the location of the files can be set either globally or per virtual host basis.
Where does Apache httpd store its log files?
Anyone who can write to the directory where Apache httpd is writing a log file can almost certainly gain access to the uid that the server is started as, which is normally root. Do NOT give people write access to the directory the logs are stored in without being aware of the consequences; see the security tips document for details.
What is the format of Apache log messages?
The second argument, format specifies the format of the log messages. It can be either an explicit format definition or a nickname defined by the LogFormat directive. To avoid repeating the same code multiple times, prefer defining the LogFormat directive and using it as a nickname in the CustomLog directive.
What’s the key give-away in Apache logs?
The key give-away is the part of the log which reads: What the attacker (or unknowing participant) has done is to set their web browser’s http referer header to everything you see after the word “referer” in your log. If your server is vulnerable then the () { :;}; will cause everything following it to be executed.
Where are Apache log files located in CentOS?
Location of the Log Files By default on Debian-based distributions such as Ubuntu, access and error logs are located in the /var/log/apache2 directory. On CentOS the log files are placed in /var/log/httpd directory. Reading and Understanding the Apache Log Files
Where are error messages written on a virtual host?
Virtual hosts without CustomLog or ErrorLog directives will have their log messages written to the global server logs. For better readability, it is recommended to set separate access and error log files for each virtual host. Here is an example: