Apache override templates installed warning

Miguel G

Well-Known Member
Jun 4, 2015
86
0
6
Spain
cPanel Access Level
Root Administrator
Twitter
Following up this thread

Apache log format issue with EasyApache 4 (apache 2.4), Varnish and mod_remoteip

I currently have 68.0.36 and I get this warning:

This system has the following Apache override templates installed:
  • /var/cpanel/templates/apache2_4/ea4_main.local
I have copied ea4_main.default again and change %h to %a but I still get the warning and logs are not getting the real IP address anymore.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
Hello,


Where are you receiving that warning? The warning just seems to indicate that you're using a customized template, which in this instance (looking back at the old thread) it appears that you are in order to get the IP address to be viewed correctly.

When you're copying ea4_main.default are you renaming it to main.local as well?


Thank you,
 

Miguel G

Well-Known Member
Jun 4, 2015
86
0
6
Spain
cPanel Access Level
Root Administrator
Twitter
It shows up in the Apache Configuration section. I´m doing as stated in the old thread:

cp /var/cpanel/templates/apache2_4/ea4_main.default /var/cpanel/templates/apache2_4/ea4_main.local

I have replaced %h by %a in LogFormat entries but for some reason I´m not getting the Real IP address as I have last weeks.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
Hello,


With your change in place can you rebuild the apache configuration and restart apache? I usually do the following:

Code:
mv /etc/apache2/conf/httpd.conf{,.bak}
/scripts/rebuildhttpdconf
/scripts/restartsrv_httpd
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
Hi @Miguel G

Yes, please do open a ticket so we can take a closer look, once it's open please post the ticket number here so we can update this thread with the outcome.

Thank you,
 

Miguel G

Well-Known Member
Jun 4, 2015
86
0
6
Spain
cPanel Access Level
Root Administrator
Twitter
Not sure if this was overriden by any update but this seems to work

It seems that configuring the trusted IP proxies for remote ip did the trick:

[email protected] [/root# vi /etc/apache2/conf.modules.d/370_mod_remoteip.conf

Code:
# Enable mod_remoteip
LoadModule remoteip_module modules/mod_remoteip.so

<IfModule remoteip_module>
 # These settings are specific to your environment, so
 # we'll leave them commented out until you manually set
 # them. I recommend carefully reading the documentation
 # as misconfiguration of this module can result in
 # potential data compromise.
 #
 # https://httpd.apache.org/docs/trunk/mod/mod_remoteip.html
 # ---------------------------------------------------------

 RemoteIPHeader X-Forwarded-For
 RemoteIPTrustedProxy XXX.XXX.XXX.XXX

</IfModule>