Skip to content

Commit

Permalink
Add support for specifying the docroot option for RHEL SCL httpd24
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jktjkt authored and igalic committed Nov 7, 2014
1 parent 23a2dde commit 3111c0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
$log_level = $::apache::params::log_level,
$log_formats = {},
$ports_file = $::apache::params::ports_file,
$docroot = $::apache::params::docroot,
$apache_version = $::apache::version::default,
$server_tokens = 'OS',
$server_signature = 'On',
Expand Down Expand Up @@ -239,23 +240,20 @@
if $::apache::conf_dir and $::apache::params::conf_file {
case $::osfamily {
'debian': {
$docroot = '/var/www'
$pidfile = "\${APACHE_PID_FILE}"
$error_log = 'error.log'
$error_documents_path = '/usr/share/apache2/error'
$scriptalias = '/usr/lib/cgi-bin'
$access_log_file = 'access.log'
}
'redhat': {
$docroot = '/var/www/html'
$pidfile = 'run/httpd.pid'
$error_log = 'error_log'
$error_documents_path = '/var/www/error'
$scriptalias = '/var/www/cgi-bin'
$access_log_file = 'access_log'
}
'freebsd': {
$docroot = '/usr/local/www/apache22/data'
$pidfile = '/var/run/httpd.pid'
$error_log = 'httpd-error.log'
$error_documents_path = '/usr/local/www/apache22/error'
Expand Down
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
$fastcgi_lib_path = undef
$mime_support_package = 'mailcap'
$mime_types_config = '/etc/mime.types'
$docroot = '/var/www/html'
if $::osfamily == "RedHat" {
$wsgi_socket_prefix = '/var/run/wsgi'
} else {
Expand Down Expand Up @@ -160,6 +161,7 @@
$fastcgi_lib_path = '/var/lib/apache2/fastcgi'
$mime_support_package = 'mime-support'
$mime_types_config = '/etc/mime.types'
$docroot = '/var/www'

#
# Passenger-specific settings
Expand Down Expand Up @@ -270,6 +272,7 @@
$mime_support_package = 'misc/mime-support'
$mime_types_config = '/usr/local/etc/mime.types'
$wsgi_socket_prefix = undef
$docroot = '/usr/local/www/apache22/data'
} else {
fail("Class['apache::params']: Unsupported osfamily: ${::osfamily}")
}
Expand Down

0 comments on commit 3111c0d

Please sign in to comment.