[Mageia-sysadm] [778] add a reverse proxy class

root at mageia.org root at mageia.org
Thu Jan 13 19:12:30 CET 2011


Revision: 778
Author:   misc
Date:     2011-01-13 19:12:29 +0100 (Thu, 13 Jan 2011)
Log Message:
-----------
add a reverse proxy class

Modified Paths:
--------------
    puppet/modules/apache/manifests/init.pp

Added Paths:
-----------
    puppet/modules/apache/templates/vhost_reverse_proxy.conf

Modified: puppet/modules/apache/manifests/init.pp
===================================================================
--- puppet/modules/apache/manifests/init.pp	2011-01-13 18:12:28 UTC (rev 777)
+++ puppet/modules/apache/manifests/init.pp	2011-01-13 18:12:29 UTC (rev 778)
@@ -80,6 +80,12 @@
             mode => 644,
         }
     }
+    
+    class mod_proxy inherits base {
+        package { "apache-mod_proxy":
+            ensure => installed
+        }
+    }
 
     define vhost_redirect_ssl() {
         file { "redirect_ssl_$name.conf":
@@ -177,6 +183,19 @@
         }
     } 
 
+    define vhost_reverse_proxy($url) {
+        include apache::mod_proxy
+        file { "$name.conf":
+            path => "/etc/httpd/conf/vhosts.d/$name.conf",
+            ensure => "present",
+            owner => root,
+            group => root,
+            mode => 644,
+            notify => Service['apache'],
+            content => template("apache/vhost_reverse_proxy.conf")
+        }
+    }
+
    define webapp_other($webapp_file) {
         include apache::base
         $webappname = $name

Added: puppet/modules/apache/templates/vhost_reverse_proxy.conf
===================================================================
--- puppet/modules/apache/templates/vhost_reverse_proxy.conf	                        (rev 0)
+++ puppet/modules/apache/templates/vhost_reverse_proxy.conf	2011-01-13 18:12:29 UTC (rev 778)
@@ -0,0 +1,22 @@
+<VirtualHost *:80>
+        ServerName <%= name %>
+        # Serve static content directly
+        DocumentRoot  /dev/null
+
+
+
+        ProxyRequests Off
+
+        <Proxy *>
+            Order deny,allow
+            Allow from all
+        </Proxy>
+
+        ProxyPass / <%= url %>
+        ProxyPassReverse / <%= url %>
+
+        <Location />
+            Allow from all
+        </Location>
+</VirtualHost>
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20110113/cc94c1fc/attachment-0001.html>


More information about the Mageia-sysadm mailing list