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


Copyright 2021. All rights reserved.

Posted 3 January 2022 by admin in category "simple memo

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.