| PLEX86 | ||
|
Logrotate is a pain 3732From the apache docs......... periodically rotate the log files by moving or deleting the existing logs. This cannot be done while the server is running, because Apache will continue writing to the old log file as long as it holds the file open. Instead, the server must be 39restarted after the log files are moved or deleted so that it will open new log files. By using a graceful restart, the server can be instructed to open new log files without losing any existing or pending connections from clients. However, in order to accomplish this, the server must continue to write to the old log files while it finishes serving old requests. It is therefore necessary to wait for some time after the restart before doing any processing on the log files. A typical scenario that simply rotates the logs and compresses the old logs to save space is: mv accesslog accesslog.old mv errorlog errorlog.old apachectl graceful sleep 600 gzip accesslog.old errorlog.old
Apache httpd is capable of writing error and access log files through a pipe to another process, rather than directly to a file. This capability dramatically increases the flexibility of logging, without adding code to the main server. In order to write logs to a pipe, simply replace the filename with the pipe character ", followed by the name of the executable which should accept log entries on its standard input. Apache will start the piped-log process when the server starts, and will restart it if it crashes while the server is running. (This last feature is why we can refer to this technique as "reliable piped logging".) Logrotate is a pain 3733 Fritz Bayer wrote (in part): Have you read man logrotate ? Here is part of it. # sample logrotate configuration file compress var-log-messages { rotate 5 weekly... Piped log processes are spawned by the parent Apache httpd process, and inherit the userid of that process. This means that piped log programs usually run as root. It is therefore very important to keep the programs simple and secure. One important use of piped logs is to allow log rotation without having to restart the server. The Apache HTTP Server includes a simple program called 41rotatelogs for this purpose. For example, to rotate the logs every 24 hours, you can use: =================== I read what I read....what can I say.... ken
|
||||
Linux groups from Newsgroups The #1 Usenet Provider on the Internet
|
||||