From a267f0193505601c5be22f3a19423281280b6ec4 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 26 May 2013 20:44:02 -0300 Subject: Adding remote_addr parameter --- manifests/init.pp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 1c4d24f..d90b5bc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -37,6 +37,7 @@ class apache( $default_folder = '/var/www/data', $server_name = $hostname, $https_proxy = 'no' + $remote_addr = false, ) { include ssl @@ -165,6 +166,20 @@ class apache( notify => Service["apache"], } + # remote addr rewrite + # see http://stackoverflow.com/questions/2328225/how-to-set-remote-addr-in-apache-before-php-is-invoked + file { "$conf_d/remote-addr": + ensure => $remote_addr ? { + false => absent, + default => present, + }, + content => "RequestHeader set REMOTE_ADDR ${remote_addr}\n", + owner => root, + group => root, + mode => 0644, + notify => Service["apache"], + } + # Notify this when apache needs a reload. This is only needed when # sites are added or removed, since a full restart then would be # a waste of time. When the module-config changes, a force-reload is -- cgit v1.2.3