Fixed apache user and group handing on Ubuntu

This commit is contained in:
Ossi Salmi 2011-03-09 14:02:45 +02:00 committed by Timo Mkinen
parent 2904008ee2
commit 7b10e62e1c
2 changed files with 18 additions and 14 deletions

View file

@ -5,6 +5,21 @@ import "redhat.pp"
#
class apache::common {
case $operatingsystem {
debian,ubuntu: {
if ! $httpd_user {
$user = "www-data"
} else {
$user = $httpd_user
}
if ! $httpd_group {
$group = "www-data"
} else {
$group = $httpd_group
}
}
}
if $apache_datadir {
file { "${apache_datadir}":
ensure => directory,
@ -90,16 +105,6 @@ class apache::server inherits apache::common {
case $operatingsystem {
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
}
centos,fedora: {
@ -194,8 +199,6 @@ class apache::sslserver inherits apache::common {
case $operatingsystem {
debian,ubuntu: {
$user = "www-data"
$group = "www-data"
include apache::debian::sslserver
}
centos,fedora: {

View file

@ -3,9 +3,10 @@
# 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,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=<%= scope.lookupvar('apache::server::user') %>
export APACHE_RUN_GROUP=<%= scope.lookupvar('apache::server::group') %>
export APACHE_RUN_USER=<%= scope.lookupvar('apache::common::user') %>
export APACHE_RUN_GROUP=<%= scope.lookupvar('apache::common::group') %>
export APACHE_PID_FILE=/var/run/apache2.pid
export APACHE_RUN_DIR=/var/run/apache2
## The locale used by some modules like mod_dav
export LANG=C