Large Apache Log files in the Virtual Assurance Directory

book

Article ID: 36618

calendar_today

Updated On:

Products

CA Server Automation CA Virtual Assurance for IM

Issue/Introduction

Symptoms:

The log files in X:\CA\VirtualAssurance\apache\logs grow very large - potentially gigs in size.

Cause:

This is the default configuration for Apache. Log files do not rotate or wrap-around. They have unrestricted growth.

Resolution:

Apache can be configured to rotate log files. This will prevent individual logs from growing to gigs in size. However, the older logs still need to be cleaned up/removed via other methods. This configuration only provides Apache the facilities to create log files in a more workable size.

 

  1. Stop the CAAIPApache Service.
  2. Open the X:\CA\VirtualAssurance\apache\conf\httpd.conf in a text editor.
  3. Look for the original entries and replace them with the updated entries based on this table:
    Original EntryUpdated Entry
    ErrorLog "logs/error.log"ErrorLog "|bin/rotatelogs.exe -l -f logs/errorlog.%Y-%m-%d-%H_%M_%S 10M"
    CustomLog "logs/access.log" commonCustomLog "|bin/rotatelogs.exe -l -f logs/access.log.%Y-%m-%d-%H_%M_%S 10M" common
  4. Save the the httpd.conf.
  5. Open the X:\CA\VirtualAssurance\apache\conf\extra\httpd-ssl.conf in a text editor.
  6. Look for the original entries and replace them with the updated entries based on this table:
    Original EntryUpdated Entry
    ErrorLog "X:/CA/VirtualAssurance/apache/logs/error.log"ErrorLog "|bin/rotatelogs.exe -l -f logs/errorlog.%Y-%m-%d-%H_%M_%S 10M"
    TransferLog "X:/CA/VirtualAssurance/apache/logs/access.log"TransferLog "|bin/rotatelogs.exe -l -f logs/access.log.%Y-%m-%d-%H_%M_%S 10M"
    CustomLog "X:/CA/VirtualAssurance/apache/logs/ssl_request.log" \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    CustomLog "|bin/rotatelogs.exe -l -f logs/ssl_request.log.%Y-%m-%d-%H_%M_%S 10M" \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    Note, the "CustomLog" entry spans two lines. This is the correct configuration.
  7. Save the httpd-ssl.conf
  8. Restart the CAAIPApache Service

Additional Information:

  • The above resolution will have Apache generate 10 MB log files.
  • Feel free to adjust the size as desired.
  • The size is configured by the "10M" directive in the above examples.
  • Apache will not automatically delete the old logs. However, having the logging output to multiple/smaller logs will allow for logs to be removed/deleted without shutting down the service.

Apache HTTPD Rotate Logs documentation

Environment

Release: SEAUBC99000-12.7-Server Automation-Base Configuration
Component: