SOLVED custom log settings in userdata conf file not working

carock

Well-Known Member
Sep 25, 2002
270
9
168
St. Charles, MO
I have sites behind a web firewall, so the access logs show that one IP.

I have the firewall configured to use X-Forwarded-For header to relay the real client IP.

I configured a customer userdata config file setting to create the log format.

Following the instructions Modify Virtualhost Containers With Include Files - EasyApache - cPanel Documentation

And tailing the log, it isn't logging with the new format.

Here's what I have in the userdata config file.

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined-waf
CustomLog /etc/apache2/logs/domlogs/website.com combined-waf

Any ideas?

Thanks,
Chuck
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463

carock

Well-Known Member
Sep 25, 2002
270
9
168
St. Charles, MO
Hello @carock,

Did you already install mod_remoteip on this server? If not, you can install it using the following command:

Code:
yum install ea-apache24-mod_remoteip
Once it's installed, take a look at the instructions/discussion on the following threads for information on the specific entries to add to the Apache configuration:

Apache override templates installed warning
SOLVED - Visitor IPs in Logs using cloudflare
mod_cloudflare vs mod_remoteip

Let us know if this helps.

Thank you.
Somewhere in those it started working.

I did all of the things in those links and it wasn't working. I went to lunch and when I came back it was working. ??

Thank you for the help
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello @carock,

I'm glad to see it worked out. Let us know if you have any additional questions.

Thanks!