Apache Log Files Not Visible After Template Update
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
-
Hey there! I'm looking into this and hope to have more details soon. 0 -
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? 0 -
I tried turning off the piped logging, but that had no effect. 0 -
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. 0 -
Ticket ID# is #94359595 0 -
Thanks for that - I'm following along with the ticket now. 0 -
It looks like David was able to get you some good details about the custom formatting in the ticket. 0
Please sign in to leave a comment.
Comments
7 comments