summaryrefslogtreecommitdiffstats
path: root/roles/httpd/templates
diff options
context:
space:
mode:
authorMichael Scherer <misc@ephaone.org>2014-10-15 16:55:11 -0400
committerMichael Scherer <misc@ephaone.org>2014-10-15 16:55:11 -0400
commitdd06fb0a56feba126cce5ef75e84e23eb72fe7aa (patch)
treef20f7774e7d7ce6ec22eeb8d62e510842c613733 /roles/httpd/templates
parent56599284ed73be3661796003d89c3ed73aa24cbd (diff)
Add playbook and httpd and the rest
Diffstat (limited to 'roles/httpd/templates')
-rw-r--r--roles/httpd/templates/vhost.conf21
-rw-r--r--roles/httpd/templates/vhost_redirect.conf16
2 files changed, 37 insertions, 0 deletions
diff --git a/roles/httpd/templates/vhost.conf b/roles/httpd/templates/vhost.conf
new file mode 100644
index 0000000..21172c9
--- /dev/null
+++ b/roles/httpd/templates/vhost.conf
@@ -0,0 +1,21 @@
+<VirtualHost *:80>
+ {% if website_password is defined %}
+ <Location />
+
+ AuthType Basic
+ AuthName "Restricted access, contact OSAS for password"
+ AuthUserFile /etc/httpd/{{ website_url }}.htpasswd
+ Require valid-user
+ </Location>
+ {% endif %}
+
+ <Directory "{{ document_root }}">
+ AllowOverride All
+ </Directory>
+
+ ServerName {{ website_url }}
+ DocumentRoot {{ document_root }}
+ Include /etc/httpd/conf.d/{{ website_url}}.conf.d/*conf
+</VirtualHost>
+
+
diff --git a/roles/httpd/templates/vhost_redirect.conf b/roles/httpd/templates/vhost_redirect.conf
new file mode 100644
index 0000000..1c93343
--- /dev/null
+++ b/roles/httpd/templates/vhost_redirect.conf
@@ -0,0 +1,16 @@
+<VirtualHost *:80>
+ {% if website_password is defined %}
+ <Location />
+
+ AuthType Basic
+ AuthName "Restricted access, contact OSAS for password"
+ AuthUserFile /etc/httpd/{{ website_url }}.htpasswd
+ Require valid-user
+ </Location>
+ {% endif %}
+
+ ServerName {{ website_url }}
+ Redirect / {{ redirect }}
+</VirtualHost>
+
+