January 3

cPanel: fix real IPs after proxy installed

one string script:

yum install -y ea-apache24-mod_remoteip;echo '' > /etc/apache2/conf.modules.d/370_mod_remoteip.conf; echo -e "LoadModule remoteip_module modules/mod_remoteip.so\nRemoteIPHeader X-Forwarded-For\nRemoteIPInternalProxy 127.0.0.1\n" >> /etc/apache2/conf.modules.d/370_mod_remoteip.conf; for i in `ip a|grep inet|grep -v "inet6\|127.0.0.1"|awk {'print $2'}|awk -F/ {'print $1'}`;do echo -e "RemoteIPInternalProxy $i" >> /etc/apache2/conf.modules.d/370_mod_remoteip.conf;done;service httpd restart

January 3

Round-robin DNS for cPanel DNS only:

first, we need to create the custom template:
nano /var/cpanel/zonetemplates/root_standard
content:
; cPanel %cpversion%
; Zone file for %domain%
$TTL %ttl%
@ %nsttl% IN SOA %nameserver%. %rpemail%. (
%serial% ; serial, todays date+todays
3600 ; refresh, seconds
1800 ; retry, seconds
1209600 ; expire, seconds
86400 ) ; minimum, seconds

%domain%. %nsttl% IN NS %nameserver%.
%domain%. %nsttl% IN NS %nameserver2%.
%domain%. %nsttl% IN NS %nameserver3%.
%domain%. %nsttl% IN NS %nameserver4%.

%nameserverentry%. IN A %nameservera%
%nameserverentry2%. IN A %nameservera2%
%nameserverentry3%. IN A %nameservera3%
%nameserverentry4%. IN A %nameservera4%

%domain%. IN A 2.2.2.2
%domain%. IN A 3.3.3.3

www IN CNAME %domain%.

Then we can add the new domain from the command line:
whmapi1 adddns domain='test3.com' ip='1.1.1.1'