Fixed apache user and group handing on Ubuntu
This commit is contained in:
parent
2904008ee2
commit
7b10e62e1c
2 changed files with 18 additions and 14 deletions
|
@ -5,6 +5,21 @@ import "redhat.pp"
|
||||||
#
|
#
|
||||||
class apache::common {
|
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 {
|
if $apache_datadir {
|
||||||
file { "${apache_datadir}":
|
file { "${apache_datadir}":
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
|
@ -90,16 +105,6 @@ 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: {
|
||||||
|
@ -194,8 +199,6 @@ 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: {
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
# 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=<%= scope.lookupvar('apache::server::user') %>
|
export APACHE_RUN_USER=<%= scope.lookupvar('apache::common::user') %>
|
||||||
export APACHE_RUN_GROUP=<%= scope.lookupvar('apache::server::group') %>
|
export APACHE_RUN_GROUP=<%= scope.lookupvar('apache::common::group') %>
|
||||||
export APACHE_PID_FILE=/var/run/apache2.pid
|
export APACHE_PID_FILE=/var/run/apache2.pid
|
||||||
|
export APACHE_RUN_DIR=/var/run/apache2
|
||||||
|
|
||||||
## The locale used by some modules like mod_dav
|
## The locale used by some modules like mod_dav
|
||||||
export LANG=C
|
export LANG=C
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue