diff --git a/apache/manifests/init.pp b/apache/manifests/init.pp index 2f172d7..c5965ab 100644 --- a/apache/manifests/init.pp +++ b/apache/manifests/init.pp @@ -38,8 +38,22 @@ class apache::common { # Configure HTTP server. # +# === Global variables +# +# $httpd_user: +# User httpd runs as. Defaults to apache. +# $httpd_group: +# Group httpd runs as. Defaults to apache. +# class apache::server inherits apache::common { + if ! $httpd_user { + $httpd_user = "apache" + } + if ! $httpd_group { + $httpd_group = "apache" + } + file { [ "/etc/httpd/conf.http.d", "/etc/httpd/site.http.d", "/srv/www/http", @@ -147,8 +161,22 @@ define apache::site($root="", $config="") { # Configure HTTPS server. # +# === Global variables +# +# $httpsd_user: +# User httpsd runs as. Defaults to httpsd. +# $httpsd_group: +# Group httpsd runs as. Defaults to httpsd. +# class apache::sslserver inherits apache::common { + if ! $httpsd_user { + $httpsd_user = "httpsd" + } + if ! $httpsd_group { + $httpsd_group = "httpsd" + } + package { "mod_ssl": ensure => installed } diff --git a/apache/templates/httpd.conf.erb b/apache/templates/httpd.conf.erb index d1e88f2..fe5bc78 100644 --- a/apache/templates/httpd.conf.erb +++ b/apache/templates/httpd.conf.erb @@ -230,8 +230,8 @@ Include conf.http.d/*.conf # when the value of (unsigned)Group is above 60000; # don't use Group #-1 on these systems! # -User apache -Group apache +User <%= httpd_user %> +Group <%= httpd_group %> ### Section 2: 'Main' server configuration # @@ -306,7 +306,7 @@ DocumentRoot "/srv/www/http/<%= fqdn %>" # # This should be changed to whatever you set DocumentRoot to. # - + # # Possible values for the Options directive are "None", "All", @@ -355,7 +355,9 @@ DocumentRoot "/srv/www/http/<%= fqdn %>" # of a username on the system (depending on home directory # permissions). # - UserDir disable + # puppet note: commented to make it possible to configure UserDir via + # included config. UserDir is disabled by default since apache 2.1.14. + #UserDir disable # # To enable requests to /~user/ to serve the user's public_html diff --git a/apache/templates/httpsd.conf.erb b/apache/templates/httpsd.conf.erb index f2b246a..437b867 100644 --- a/apache/templates/httpsd.conf.erb +++ b/apache/templates/httpsd.conf.erb @@ -230,8 +230,8 @@ Include conf.https.d/*.conf # when the value of (unsigned)Group is above 60000; # don't use Group #-1 on these systems! # -User httpsd -Group httpsd +User <%= httpsd_user %> +Group <%= httpsd_group %> ### Section 2: 'Main' server configuration # @@ -306,7 +306,7 @@ DocumentRoot "/srv/www/https/<%= fqdn %>" # # This should be changed to whatever you set DocumentRoot to. # - + # # Possible values for the Options directive are "None", "All", @@ -355,7 +355,9 @@ DocumentRoot "/srv/www/https/<%= fqdn %>" # of a username on the system (depending on home directory # permissions). # - UserDir disable + # puppet note: commented to make it possible to configure UserDir via + # included config. UserDir is disabled by default since apache 2.1.14. + #UserDir disable # # To enable requests to /~user/ to serve the user's public_html