diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-05-26 20:44:02 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-05-26 20:44:02 -0300 |
commit | a267f0193505601c5be22f3a19423281280b6ec4 (patch) | |
tree | 4f8f3218ac7d3331fb466194613ff93cd6cf2eb2 | |
parent | 789a003e15f933c93d02e3cf58ae2ea12181a21c (diff) | |
download | puppet-apache-a267f0193505601c5be22f3a19423281280b6ec4.tar.gz puppet-apache-a267f0193505601c5be22f3a19423281280b6ec4.tar.bz2 |
Adding remote_addr parameter
-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 |