Skip to content

Commit

Permalink
Use piped logging to rotate Apache logs (#1371)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpalmer authored Jul 13, 2020
1 parent fbdc6f5 commit 8178282
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
11 changes: 0 additions & 11 deletions configuration/logrotate.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,3 @@
missingok
dateext
}

/var/log/xdmod/apache*.log
{
su root root
create 0640 root root
rotate 4
weekly
compress
missingok
dateext
}
5 changes: 3 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ to indicate to web browsers that the Open XDMoD instance should only be accesse
# </IfModule>
#</Directory>
ErrorLog /var/log/xdmod/apache-error.log
CustomLog /var/log/xdmod/apache-access.log combined
# Update the path to rotatelogs if it is different on your system.
ErrorLog "|/usr/sbin/rotatelogs -n 5 /var/log/xdmod/apache-error.log 1M"
CustomLog "|/usr/sbin/rotatelogs -n 5 /var/log/xdmod/apache-access.log 1M" combined
</VirtualHost>
```

Expand Down
16 changes: 15 additions & 1 deletion docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,19 @@ necessary.
### Configuration File Changes

The `xdmod-upgrade` script will migrate user editable configuration files to
the new version.
the new version, excluding the Apache and `logrotate` configuration files,
which may need to be manually updated.

The Apache access log and error log now use the [piped logging
feature][apache-logs-piped] combined with the [Apache `rotatelogs`
program][apache-rotatelogs] to rotate logs based on the size of the log files
to limit the total amount of storage used by these log files. Since these
files are no longer rotated by `logrotate`, any preexisting rotated log files
will need to be manually deleted.

If the `logrotate` configuration file was modified you will need to manually
remove the section for the Apache log files if you use the piped logging
feature with `rotatelogs`.

### Database Changes

Expand Down Expand Up @@ -170,3 +182,5 @@ Cloud realm should be recreated.

[github-latest-release]: https://github.com/ubccr/xdmod/releases/latest
[mysql-config]: software-requirements.md#mysql
[apache-logs-piped]: https://httpd.apache.org/docs/2.4/logs.html#piped
[apache-rotatelogs]: https://httpd.apache.org/docs/2.4/programs/rotatelogs.html
5 changes: 3 additions & 2 deletions templates/apache.conf
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
# </IfModule>
#</Directory>

ErrorLog /var/log/xdmod/apache-error.log
CustomLog /var/log/xdmod/apache-access.log combined
# Update the path to rotatelogs if it is different on your system.
ErrorLog "|/usr/sbin/rotatelogs -n 5 /var/log/xdmod/apache-error.log 1M"
CustomLog "|/usr/sbin/rotatelogs -n 5 /var/log/xdmod/apache-access.log 1M" combined
</VirtualHost>

0 comments on commit 8178282

Please sign in to comment.