Last active
December 19, 2015 11:38
-
-
Save openprojdev/5948608 to your computer and use it in GitHub Desktop.
Revisions
-
openprojdev revised this gist
Jul 8, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ # This script should run before http starts, experiment to get it right. # Configuration section network_id='192.168' # first 2 digits of the IP address identifying the network, usually would be an private ip address reange. partial_ip_address=`ifconfig | grep 'inet addr:' | grep $network_id | awk -F: '{print $2}' | awk '{print $1}' | awk -F. '{print $3"."$4}'` apache_conf_file='/etc/apache2/conf.d/X-fry' # RHEL/CentOS could be /etc/http/conf.d/X-fry -
openprojdev created this gist
Jul 8, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/bin/sh # Only publish the last 2 digits of an IP address, do not expose the complete network range # place this script post testing some were like /etc/rc.local, were issues like dynamic address, or cloned machines in cloud env will have an updated IP address in http header # This script should run before http starts, experiment to get it right. # Configuration section network_id = '192.168' # first 2 digits of the IP address identifying the network, usually would be an private ip address reange. partial_ip_address=`ifconfig | grep 'inet addr:' | grep $network_id | awk -F: '{print $2}' | awk '{print $1}' | awk -F. '{print $3"."$4}'` apache_conf_file='/etc/apache2/conf.d/X-fry' # RHEL/CentOS could be /etc/http/conf.d/X-fry echo '<IfModule mod_headers.c>' > $apache_conf_file echo " Header add X-Fry \"$partial_ip_address\"" >> $apache_conf_file echo '</IfModule>' >> $apache_conf_file