Apache Log Files Not Visible After Template Update

Operating System & Version
CENTOS 7.9 kvm
cPanel & WHM Version
v98.0.6

lila.godel

Registered
Sep 1, 2021
3
0
1
Knoxville, TN
cPanel Access Level
Root Administrator
Recently new vhost.default and ssl_vhost.default files were installed in /var/cpanel/templates/apache2_4 on my cpanel server.

As I usually do when new default templates are installed I followed the steps below:

1. Copy vhost.local to vhost.bak and ssl_vhost.local to ssl_vhost.bak.
2. Copy vhost.default to vhost.local and ssl_vhost.default to ssl_vhost.local.
3. Edit the two .local files to remove the lines that read

[% IF logstyle == 'combined' -%]
[%- IF !enable_piped_logs || !supported.mod_log_config -%]
CustomLog [% paths.dir_domlogs %]/[% wildcard_safe(vhost.log_servername) %] combined env=!isproxyrequest
[%- END %]
[% ELSE %]
TransferLog [% paths.dir_domlogs %]/[% wildcard_safe(vhost.log_servername) %]
[% END -%]

4. Replace them with

[% IF !vhost.servername=="*.hamiltonservices.net" -%]
LogFormat COMBINED
TransferLog [% serverroot %]/logs/dmlogs/logs/[% vhost.servername %]/access_log
ErrorLog [% serverroot %]/logs/dmlogs/logs/[% vhost.servername %]/error_log
[% END -%]

5. Run scripts/ensure_vhost_includes --all-users from a terminal window.

Know when I go to a terminal window and enter ls -l /etc/apache2/logs/dmlogs/logs/X where X is the name of a domain hosted by the server the accesss_log and error_log files are 0 bytes.

If I go to a terminal window and enter ls -l /usr/local/apache/domlogs/X where X is the username for a domain hosted by the server I see files named X and X-ssl_log where X is the domain name that appear to contain the log data.

How can I get my logs to function like they did before so that when my WebLog Expert program accesses the mount points at /home/X/logs where X is a domain name via FTP it can the read access_log_bak and error_log_bak files created from the access_log and error_log files by monthly execution of /etc/web-logs.sh?

Mount points are set via a /etc/mount.sh script that runs during reboots.

/etc/mount.sh contains a line for each domain that reads:
mount --bind /etc/apache2/logs/dmlogs/logs/DM/home/UN/logs where DM is a domain name and UN is username
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
Alright, I've been playing around with the log settings on my personal machine for a bit and I have two thoughts - piped logging and Nginx.

If you have Nginx enabled the Apache domlogs are not going to get update normally. You'd want to be looking in /var/log/nginx/domains for that traffic.

If you do have piped logging enabled, can you try toggling that off in WHM >> Apache Configuration to see if that changes the behavior?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
It sounds like there's other issues happening with the logging on that machine and it would likely be best if we examined the server directly. Could you open a ticket with our team so we can take a look? If you can do that, please post the number here so I can follow along.