Migrated $httpd_user, $httpd_group, $httpsd_user and $httpsd_group variables to use format $apache::server::{user,group} and $apache::sslserver::{user,group}.

This commit is contained in:
Timo Mkinen 2011-02-25 11:46:57 +02:00
parent 61b1501079
commit e3b6cca7a4
5 changed files with 38 additions and 20 deletions

View file

@ -90,9 +90,29 @@ class apache::server inherits apache::common {
case $operatingsystem { case $operatingsystem {
debian,ubuntu: { debian,ubuntu: {
if ! $httpd_user {
$user = "www-data"
} else {
$user = $httpd_user
}
if ! $httpd_group {
$group = "www-data"
} else {
$group = $httpd_group
}
include apache::debian::server include apache::debian::server
} }
centos,fedora: { centos,fedora: {
if ! $httpd_user {
$user = "apache"
} else {
$user = $httpd_user
}
if ! $httpd_group {
$group = "apache"
} else {
$group = $httpd_group
}
include apache::redhat::server include apache::redhat::server
} }
default: { default: {
@ -174,9 +194,21 @@ class apache::sslserver inherits apache::common {
case $operatingsystem { case $operatingsystem {
debian,ubuntu: { debian,ubuntu: {
$user = "www-data"
$group = "www-data"
include apache::debian::sslserver include apache::debian::sslserver
} }
centos,fedora: { centos,fedora: {
if ! $httpsd_user {
$user = "httpsd"
} else {
$user = $httpsd_user
}
if ! $httpsd_group {
$group = "httpsd"
} else {
$group = $httpsd_group
}
include apache::redhat::sslserver include apache::redhat::sslserver
} }
default: { default: {

View file

@ -1,12 +1,5 @@
class apache::redhat::server { class apache::redhat::server {
if ! $httpd_user {
$httpd_user = "apache"
}
if ! $httpd_group {
$httpd_group = "apache"
}
file { [ "/etc/httpd/conf.http.d", file { [ "/etc/httpd/conf.http.d",
"/etc/httpd/site.http.d", "/etc/httpd/site.http.d",
"/srv/www/http", "/srv/www/http",
@ -122,13 +115,6 @@ define apache::redhat::site($aliases, $root, $redirect) {
class apache::redhat::sslserver { class apache::redhat::sslserver {
if ! $httpsd_user {
$httpsd_user = "httpsd"
}
if ! $httpsd_group {
$httpsd_group = "httpsd"
}
package { "mod_ssl": package { "mod_ssl":
ensure => installed ensure => installed
} }

View file

@ -3,8 +3,8 @@
# Since there is no sane way to get the parsed apache2 config in scripts, some # Since there is no sane way to get the parsed apache2 config in scripts, some
# settings are defined via environment variables and then used in apache2ctl, # settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc. # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=<%= httpd_user %> export APACHE_RUN_USER=<%= scope.lookupvar('apache::server::user') %>
export APACHE_RUN_GROUP=<%= httpd_group %> export APACHE_RUN_GROUP=<%= scope.lookupvar('apache::server::group') %>
export APACHE_PID_FILE=/var/run/apache2.pid export APACHE_PID_FILE=/var/run/apache2.pid
## The locale used by some modules like mod_dav ## The locale used by some modules like mod_dav

View file

@ -230,8 +230,8 @@ Include conf.http.d/*.conf
# when the value of (unsigned)Group is above 60000; # when the value of (unsigned)Group is above 60000;
# don't use Group #-1 on these systems! # don't use Group #-1 on these systems!
# #
User <%= httpd_user %> User <%= scope.lookupvar('apache::server::user') %>
Group <%= httpd_group %> Group <%= scope.lookupvar('apache::server::group') %>
### Section 2: 'Main' server configuration ### Section 2: 'Main' server configuration
# #

View file

@ -230,8 +230,8 @@ Include conf.https.d/*.conf
# when the value of (unsigned)Group is above 60000; # when the value of (unsigned)Group is above 60000;
# don't use Group #-1 on these systems! # don't use Group #-1 on these systems!
# #
User <%= httpsd_user %> User <%= scope.lookupvar('apache::sslserver::user') %>
Group <%= httpsd_group %> Group <%= scope.lookupvar('apache::sslserver::group') %>
### Section 2: 'Main' server configuration ### Section 2: 'Main' server configuration
# #