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
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