Difference between revisions of "Apache"

Jump to navigation Jump to search
1,129 bytes added ,  11:12, 12 January 2012
Added "Log Rotation"
(More typo)
(Added "Log Rotation")
Line 9: Line 9:
| <code> /etc/apache2 </code> || Config files
| <code> /etc/apache2 </code> || Config files
|}
|}
== Log Rotation ==
There are two ways to ensure your logs get rotated...
* logrotate - The standard, cross application log rotation solution.  Its very reliable and easy to configure, but requires that Apache is restarted every time your log is rotated so that it follows the log switch around.
* rotatelog pipe - Has more overhead as logs are piped to a child process to handle, but doesn't require Apache restarts.
=== rotatelog ===
Edit you existing config file to redirect logging through the child rotatelogs process, this will probably be found in either your site config (EG in <code>/etc/apache2/sites-enabled</code>) or your Apache service config (EG in <code> /etc/apache2/ </code>)
ErrorLog  "|/usr/sbin/rotatelogs /var/log/apache2/error-%Y-%m-%d.log 86400"
CustomLog "|/usr/sbin/rotatelogs /var/log/apache2/access-%Y-%m-%d.log 86400" combined
Check that the path for <code>rotatelogs</code> is correct (search using <code> find / -iname rotatelogs </code>)
Restart Apache, perform a test page load on your site (that would generate log entries), and check that a log file has been generated as per your config


== User/pass restrictions ==
== User/pass restrictions ==

Navigation menu