Addon Domain: Changing log file location

Oranuf

Registered
May 27, 2016
2
0
1
NY
cPanel Access Level
Root Administrator
Fairly simple question, but haven't been able to find an answer through an extensive search. Relatively new to WHM and cPanel.

Once I create an AddOn Domain, the log files by default are ending up in ./usr/local/apache/domlogs/. However, i'd like to customize their location, and also make sure AWStats/Webalizer can find them. I don't see a place to configure this either in WHM or cPanel interfaces. Easy way to do both?

Code:
I have root access. System Spec:

/etc/redhat-release:CentOS release 6.8 (Final)
/usr/local/cpanel/version:11.54.0.24
/var/cpanel/envtype:vmware
CPANEL=release
Server version: Apache/2.2.29 (Unix)
Server built:   Apr  8 2015 15:10:55
Cpanel::Easy::Apache v3.28.5 rev9999
PHP 5.4.40 (cli) (built: May 19 2015 12:06:47)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with eAccelerator v0.9.6.1-ea, Copyright (c) 2004-2012 eAccelerator, by eAccelerator
    with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd., and
    with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies
mysql  Ver 14.14 Distrib 5.6.29, for Linux (x86_64) using  EditLine wrapper
 

sarath8372

Active Member
Jan 6, 2015
35
7
8
Kochi, India
cPanel Access Level
Root Administrator
Domlogs are defined in Apache main configuration file : /usr/local/apache/conf/httpd.conf . Look for CustomLog defined for the domain under its virtual host entry.

Code:
# grep yourdomain.com /usr/local/apache/conf/httpd.conf | grep CustomLog
You can modify the virtual host container for the domain by creating an include file as mentioned in : Modify Virtualhost Containers With Include Files - EasyApache - cPanel Documentation

You can look for the include file path for your domain in Apache configuration by :

Code:
# grep yourdomain.com /usr/local/apache/conf/httpd.conf | grep Include
Create an include file in the directory shown in the output of last command (file should end with .conf). Define your custom domlog file in the include file. Then run :

Code:
/scripts/verify_vhost_includes --commit
Code:
/scripts/ensure_vhost_includes --all-users
If verify script returns, "OK" finally rebuild Apache configuration file :

Code:
/scripts/rebuildhttpdconf
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,225
463
Hello,

I'm happy to see the information provided to you was helpful. Thank you for replying to let us know it helped.