diff options
-rw-r--r-- | manifests/init.pp | 15 |
1 files changed, 15 insertions, 0 deletions
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 |