In order to use the /url/local/cpanel/bin/splitlogsbinary, one must enable the Enable Piped Apache Logs setting in the piped log configuration section of WHM’s Apache Configuration interface( WHM >> Home >> Service Configuration >> Apache Configuration).
The /usr/local/cpanel/bin/splitlogs binary optimize one’s resources and performance after creating Apache logs. As for example, the /usr/local/cpanel/bin/splitlogs binary can close file handles without restarting Apache. It improves log processing and bandwidth processing performance.
Apache’s default behavior is opened and written to both a byte log file and accessing log file for each virtual host in Apache’s configuration file. And because of this, the number of open log files equals twice the number of virtual hosts in Apache’s /usr/local/apache/conf/httpd.conf file. To reduce Apache’s memory consumption, piped logs functionality is used by cPanel & WHM with the splitlogs binary to process Apache log information. The splitlogs binary only opens and writes to a single log file when a visitor accesses a virtual host.
cPanel & WHM runs two instances of the splitlogs binary: firstly to manage the byte log files, and the other to manage the access log files. The domain name and port is extracted by the splitlogs binary from the Apache logs, and this information is used as a space-separated line in the log file. This information regulates the log file’s name, which the system either writes to a specified directory, or to the default location for Apache logs in the /usr/local/apache/ directory.
It is to note that if a visitor accesses the shared IP addresses, the splitlogs binary will write only to Apache’s byte and access log file and will not write to the domain log file for the shared IP address.
The system examines the /var/cpanel/conf/splitlogs.conf file when cPanel & WHM rebuilds Apache’s configuration file. The system makes a use of the contents of this file to set command line arguments for CustomLog directives in Apache’s /usr/local/apache/conf/httpd.conf file.
The configuration file contains line-delimited key=value pairs. The key entries remain same as the command line arguments.
After specifying custom directives for the /var/cpanel/conf/splitlogs.conf file, one must rebuild and restart Apache. One needs to run the following command to do this:
This feature helps a user in many ways as reviewed in this article.