Linux logparser service

Disclaimer: this article is applicable to Standard Linux Shared Hosting, not to Linux Shared Hosting NG. Refer to article #114326 for information about Linux Shared Hosting NG in Parallels Operations Automation (POA).

The main purpose of the Parallels Operations Automation (POA) logparser service:

  • Calculate customers' website traffic usage and report it to POA

  • Initiate webalizer web statistics processing

The logparser service must be installed on every POA-managed Linux Shared Hosting server (as a corresponding POA package).

On a Linux server with the logparser service installed, POA creates a cron job like this to run the service:

30 1-23/3 * * * root
**/usr/local/pem/bin/logparser.sh** >/dev/null 2>&1

The logparser.sh script invokes the /usr/local/pem/bin/logparser binary, which processes Apache log files in all customer webspaces along with Apache and FTP log files. This traffic usage is then reported to POA.

The main logparser configuration files are:

/usr/local/pem/etc/logparser/config.xml
/usr/local/pem/etc/logparser/checkpoints.xml

For every customer's webspace, POA creates entries in the /usr/local/pem/etc/logparser/config.xml file to process Apache log files located in the webspace:

  • access_log
  • ssl_access_log
  • error_log

Log files for system services such as /var/log/httpd_access_log, /var/log/httpd_error_log, /usr/local/pem/ftp/ftp_log/VHOST_ID/xferlog and the like are defined in the above mentioned configuration files as well, so they are processed in the same way as logs of customer websites.

The checkpoints.xml file is updated with a timestamp when each log file is processed by the logparser service.

When the logparser binary is invoked by cron, it reads the XML configuration files and processes Apache logs in customer webspaces along with system log files. Once the traffic usage data stored in the logs is calculated, this is reported to POA.

The config.xml file also defines the log format for every single Apache log file. This is necessary for the logparser to be able to parse log files correctly, for example:

<format>%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"%v</format>;

During processing, the logparser also invokes the webalizer utility with parameters defined in the config.xml file to process web statistics for customer webspaces.

Logparser saves its own log in the /usr/local/pem/bin/logparser.log file on a Linux Shared Hosting server by default. Analyze this file to troubleshoot problems with log parsing and traffic usage collection in POA.

There are no logparser-related resource types in POA. The service is available for all customers with Linux Shared Hosting service subscriptions.

See Knowledgebase article #115790 Website Hosting: General information, Best Practices and Troubleshooting for more information.

Internal content