SOLVED /usr/local/apache/domlogs/IPADDRESS log rotation

vikins

Well-Known Member
Oct 3, 2006
127
1
168
I am wondering about the log file in /usr/local/apache/domlogs that is named for the IP address of the server. This log file doesn't seem to get rotated properly. How is this controlled?

For example, the first entry in this file is dated 26/Nov/2013:01:21:48 so clearly it is not being rotated.

But I have another cPanel server and it had at least rotated the file 22/Apr/2014:14:36:23.

I am just unsure what the rhyme or reason is for when these are rotated.

Thanks
 

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
835
29
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
You shouldn't have a file named after your server's IP in this folder. Do this:

grep -r $IP /var/cpanel/userdata

And see which vhost is generating this. The reason it's not getting rotated is that it's not a domain on the server, so the stats runner is not processing it.
 

vikins

Well-Known Member
Oct 3, 2006
127
1
168
Thanks for the suggestion. The command you suggested (yes, I replaced $IP) produced a huge output. The IP in question is the main shared hosting IP.

I'd be glad to keep trying suggestions.

Thanks
 

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
835
29
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
Sorry - I was a little distracted when I responded to the post. The IP showing up that much is normal. I should have told you to grep for the log as well:

grep -r $IP /var/cpanel/userdata |grep target:

This will show you what vhosts are configured to write to a log file named after an IP.
 

vikins

Well-Known Member
Oct 3, 2006
127
1
168
That returned nothing when I ran it.

Did you mean something like this?

grep -r "domlogs/$IP" /var/cpanel/userdata

But even that returns nothing.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello :)

Try browsing to the following directory:

Code:
/var/cpanel/userdata/nobody/
You will likely see a file for the IP address that is not necessary.

Thank you.
 

vikins

Well-Known Member
Oct 3, 2006
127
1
168
cPanelMichael:
There is no file in that directory named with the IP. There is one named with the host name of the server, but not the IP.

My grep would have found this already:
grep -r "domlogs/$IP" /var/cpanel/userdata

vanessa:
My httpd.conf has no entries for "domlogs" hardcoded.

So, I'm still unsure where it is defined, if it should be there, and if so how to rotate it.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Feel free to open a support ticket so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

vikins

Well-Known Member
Oct 3, 2006
127
1
168
/var/cpanel/userdata/nobody/ does show entries for two of the IP addresses assigned to the server (plus a .cache version of each). You say they are unnecessary, does that mean the solution is to remove them?

What I really want is the logs for the IP addresses to rotate (process) as any other domain logs would.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
/var/cpanel/userdata/nobody/ does show entries for two of the IP addresses assigned to the server (plus a .cache version of each). You say they are unnecessary, does that mean the solution is to remove them?

What I really want is the logs for the IP addresses to rotate (process) as any other domain logs would.
This thread originated in 2014, so it's likely some changes to how this works have occurred. Could you verify if you are currently using EasyApache 3, or EasyApache 4? Also, is "Piped Logging" enabled in "WHM Home » Service Configuration » Apache Configuration » Piped Log Configuration"? If so, it could relate to an internal case, CPANEL-3716, that's resulting in logs for the default VirtualHost to log into a separate access log instead of the primary /usr/local/apache/logs/access_log file.

I look forward to your response.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Still using EA3. Piped logging enabled.
There's no update to report for case CPANEL-3716 at this time. I'll update this thread with any new information on that case as it becomes available, but I highly recommend considering an upgrade to EasyApache 4 to see if the issue persists.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello,

To follow-up, the updated internal case number is EA-7777 and it's planned for publication with an upcoming EasyApache 4 release:

Case EA-7777: Ensure log entries for the hostname and shared IPs go to the main access_log

The case will be added to the EasyApache 4 Change Log once it's published.

Thanks!