Skip to content
Browse files

Add pear.kohanaframework.org and the "static" nginx site template

  • Loading branch information...
1 parent e5597ad commit be6dce3c358d5f1d8c12da7365aabee9dd12e644 @kiall committed Sep 23, 2011
View
2 manifests/nodes.pp
@@ -9,6 +9,7 @@
include website::www
include website::forum
include website::dev
+ include website::pear
#include website::ci
}
@@ -18,6 +19,7 @@
include website::www
include website::forum
+ include website::pear
}
node "vm02.kohanaframework.org" {
View
15 manifests/users.pp
@@ -9,7 +9,8 @@
"www-www.kohanaframework.org",
"www-dev.kohanaframework.org",
"www-forum.kohanaframework.org",
- "www-ci.kohanaframework.org"
+ "www-ci.kohanaframework.org",
+ "www-pear.kohanaframework.org"
];
"zombor":
ensure => present,
@@ -20,7 +21,8 @@
"www-www.kohanaframework.org",
"www-dev.kohanaframework.org",
"www-forum.kohanaframework.org",
- "www-ci.kohanaframework.org"
+ "www-ci.kohanaframework.org",
+ "www-pear.kohanaframework.org"
];
"samsoir":
ensure => present,
@@ -31,7 +33,8 @@
"www-www.kohanaframework.org",
"www-dev.kohanaframework.org",
"www-forum.kohanaframework.org",
- "www-ci.kohanaframework.org"
+ "www-ci.kohanaframework.org",
+ "www-pear.kohanaframework.org"
];
"isaiah":
ensure => present,
@@ -42,7 +45,8 @@
"www-www.kohanaframework.org",
"www-dev.kohanaframework.org",
"www-forum.kohanaframework.org",
- "www-ci.kohanaframework.org"
+ "www-ci.kohanaframework.org",
+ "www-pear.kohanaframework.org"
];
"brmatt":
ensure => present,
@@ -52,7 +56,8 @@
"www-www.kohanaframework.org",
"www-dev.kohanaframework.org",
"www-forum.kohanaframework.org",
- "www-ci.kohanaframework.org"
+ "www-ci.kohanaframework.org",
+ "www-pear.kohanaframework.org"
];
}
View
9 manifests/website/pear.pp
@@ -0,0 +1,9 @@
+class website::pear inherits website
+{
+ # Setup a static site
+ nginx::template::static {
+ "pear.kohanaframework.org":
+ ensure => present;
+ }
+
+}
View
11 modules/nginx/manifests/template/static.pp
@@ -0,0 +1,11 @@
+define nginx::template::static($ensure = 'present', $listen = 80, $order = '100') {
+ include nginx
+
+ # Setup the nGinx virtual host
+ nginx::site {
+ $name:
+ ensure => $ensure,
+ content => template("nginx/template/static.conf.erb"),
+ order => $order;
+ }
+}
View
20 modules/nginx/templates/template/static.conf.erb
@@ -0,0 +1,20 @@
+server {
+ listen [::]:<%=listen %>;
+
+ server_name <%=name %>;
+ root /home/www-<%=name %>/current/;
+
+ index index.htm index.html;
+
+ error_log /home/www-<%=name %>/logs/nginx.error.log;
+ access_log /home/www-<%=name %>/logs/nginx.access.log;
+
+ location / {
+ try_files $uri $uri/ =404;
+ }
+
+ # Prevent access to hidden files
+ location ~ /\. {
+ deny all;
+ }
+}

0 comments on commit be6dce3

Please sign in to comment.
Something went wrong with that request. Please try again.