Skip to content

Commit 3111c0d

Browse files
jktjktigalic
authored andcommitted
Add support for specifying the docroot option for RHEL SCL httpd24
The pattern of defining these variables in the init.pp goes back into 2012. However, it's much better to use the params.pp pattern for this purpose, and it's also required to make this work with the RHEL's Software Collections. Without this patch, the Apache::Vhost['default'] is instantiated (regardless whether it's with ensure => absent or present) and bails out due to /var/www being missing on asystem which has never had RHEL6's regular httpd package installed.
1 parent 23a2dde commit 3111c0d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

manifests/init.pp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
$log_level = $::apache::params::log_level,
6060
$log_formats = {},
6161
$ports_file = $::apache::params::ports_file,
62+
$docroot = $::apache::params::docroot,
6263
$apache_version = $::apache::version::default,
6364
$server_tokens = 'OS',
6465
$server_signature = 'On',
@@ -239,23 +240,20 @@
239240
if $::apache::conf_dir and $::apache::params::conf_file {
240241
case $::osfamily {
241242
'debian': {
242-
$docroot = '/var/www'
243243
$pidfile = "\${APACHE_PID_FILE}"
244244
$error_log = 'error.log'
245245
$error_documents_path = '/usr/share/apache2/error'
246246
$scriptalias = '/usr/lib/cgi-bin'
247247
$access_log_file = 'access.log'
248248
}
249249
'redhat': {
250-
$docroot = '/var/www/html'
251250
$pidfile = 'run/httpd.pid'
252251
$error_log = 'error_log'
253252
$error_documents_path = '/var/www/error'
254253
$scriptalias = '/var/www/cgi-bin'
255254
$access_log_file = 'access_log'
256255
}
257256
'freebsd': {
258-
$docroot = '/usr/local/www/apache22/data'
259257
$pidfile = '/var/run/httpd.pid'
260258
$error_log = 'httpd-error.log'
261259
$error_documents_path = '/usr/local/www/apache22/error'

manifests/params.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
$fastcgi_lib_path = undef
101101
$mime_support_package = 'mailcap'
102102
$mime_types_config = '/etc/mime.types'
103+
$docroot = '/var/www/html'
103104
if $::osfamily == "RedHat" {
104105
$wsgi_socket_prefix = '/var/run/wsgi'
105106
} else {
@@ -160,6 +161,7 @@
160161
$fastcgi_lib_path = '/var/lib/apache2/fastcgi'
161162
$mime_support_package = 'mime-support'
162163
$mime_types_config = '/etc/mime.types'
164+
$docroot = '/var/www'
163165

164166
#
165167
# Passenger-specific settings
@@ -270,6 +272,7 @@
270272
$mime_support_package = 'misc/mime-support'
271273
$mime_types_config = '/usr/local/etc/mime.types'
272274
$wsgi_socket_prefix = undef
275+
$docroot = '/usr/local/www/apache22/data'
273276
} else {
274277
fail("Class['apache::params']: Unsupported osfamily: ${::osfamily}")
275278
}

0 commit comments

Comments
 (0)