The TSIM or BPPM server directory (installationDir\pw\apache\logs\) contains log files which are large in size. The following logs in that directory can grow unbounded: access.log ajp.log deflate.log error_log ssl_request_log |
Use the steps below to setup the automatic rotation of the Apache logs: Windows platform: 1) Stop Apache using the "pw p e httpd" command. 2) Manually remove the files that currently exist in the installationDir\pw\apache\logs directory 3) Take a backup of the http-proxy.conf file in the ..\pw\apache\conf\extra/httpd-proxy.conf file (place the backup file in different folder outside of the BPPM/TSIM server install directory) and open the file for editing. Comment out the first line of the as follows: #CustomLog logs/ajp.log combined
4) Add a new line as first line in the file with the following text:
CustomLog "|bin/rotatelogs.exe -n 10 logs/ajp.log 10M" combined The last parameter 10M indicates that file will be rolled over once it reaches to 10MB. The -n <number> parameter indicates the number of files you want to keep. Example: with -n 3, the series of log files opened would be "logfile", "logfile1", "logfile2", then overwriting "logfile". Note. You need to repeat lines for each of the log files you want to rotate. Adjust the log file name according to how you see it in the \pw\apache\logs directory. For example: CustomLog "|bin/rotatelogs.exe -n 10 logs/access.log 10M" combined
5) Start the Apache service using command the "pw p s httpd"CustomLog "|bin/rotatelogs.exe -n 10 logs/deflate.log 10M" combined CustomLog "|bin/rotatelogs.exe -n 10 logs/error.log 10M" combined CustomLog "|bin/rotatelogs.exe -n 10 logs/error_log 10M" combined CustomLog "|bin/rotatelogs.exe -n 10 logs/install.log 10M" combined CustomLog "|bin/rotatelogs.exe -n 10 logs/ssl_request_log 10M" combined Save the changes Linux platform: 1) Stop the Apache process using the "pw p e httpd" command. 2) Manually remove the files that currently exist in the installationDir/pw/apache/logs directory 3) Take a backup of the http-proxy.conf file in the ../pw/apache/conf/extra/httpd-proxy.conf file (place the backup file in different folder outside of the BPPM/TSIM server install directory) and open the file for editing: Comment out the first line of the as follows: #CustomLog logs/ajp.log combined CustomLog "|/usr/pw/apache/bin/rotatelogs -n 10 logs/ajp.log 10M" combined
5) Start the Apache process using command the "pw p s httpd"The last parameter 10M indicates that file will be rolled over once it reaches to 10MB. The -n <number> parameter indicates the number of files you want to keep. Example: with -n 3, the series of log files opened would be "logfile", "logfile1", "logfile2", then overwriting "logfile". Note. You need to repeat lines for each log file you want to rotate. Adjust the log file name according to how you see it in the \pw\apache\logs directory. For example: CustomLog "|bin/rotatelogs -n 10 logs/access.log 10M" combined CustomLog "|bin/rotatelogs -n 10 logs/deflate.log 10M" combined CustomLog "|bin/rotatelogs -n 10 logs/error.log 10M" combined CustomLog "|bin/rotatelogs -n 10 logs/error_log 10M" combined CustomLog "|bin/rotatelogs -n 10 logs/install.log 10M" combined CustomLog "|bin/rotatelogs -n 10 logs/ssl_request_log 10M" combined Save the changes |