Cookbooks
apache2
documentation
Resource Apache2 Install

apache2_install

Back to resource list

Installs apache2.

Properties

NameTypeDefaultDescriptionAllowed Values
root_groupStringnode['root_group']Group that the root user on the box runs as. Defaults to platform specific value from ohai root_group
apache_userStringdefault_apache_userSet to override the default apache2 user. Defaults to platform specific locations, see libraries/helpers.rb
apache_groupStringdefault_apache_groupSet to override the default apache2 user. Defaults to platform specific locations, see libraries/helpers.rb
log_dirStringdefault_log_dirLog directory location. Defaults to platform specific locations, see libraries/helpers.rb
error_logStringdefault_error_logError log location. Defaults to platform specific locations, see libraries/helpers.rb
mpmStringdefault_mpmMulti-processing Module. Defaults to platform specific locations, see libraries/helpers.rb
mpm_confHash{}Configuration parameters for the MPM.
modules[String, Array]default_modulesDefaults modules, defaults to platform specific values, see libraries/helpers.rb
mod_confHash{}Configuration parameters for the defaults modules, as an Hash of Hash.
docroot_dirStringdefault_docroot_dirApache document root. Defaults to platform specific locations, see libraries/helpers.rb
run_dirStringdefault_run_dirLocation for APACHE_RUN_DIR. Defaults to platform specific locations, see libraries/helpers.rb
log_levelStringwarnlog level for apache2
apache_localeStringsystemLocale for apache2, defaults to the system locale
status_urlStringhttp://localhost:80/server-statusURL for status checks
server_nameStringlocalhostServerName value, set in apache2.conf at the server level
server_signatureStringOnServerSignature value, set in security.conf[On, Off, EMail]
server_tokensStringProdServerTokens value, set in security.conf[Major, Minor, Min, Minimal, Prod, ProductOnly, OS, Full]
trace_enableStringOffTraceEnable value, set in security.conf[On, Off, extended]
default_charset[String, Array]AddDefaultCharset value(s), set in charset.conf
httpd_t_timeoutInteger10Service timeout setting in seconds. Defaults to 10 seconds
listen[String, Array][80, 443]Port to listen on. Defaults to both 80 & 443
keep_aliveStringOndescription: 'Persistent connection feature of HTTP/1.1 provide long-lived HTTP sessions'[On, Off]
max_keep_alive_requestsInteger100MaxKeepAliveRequests
keep_alive_timeoutInteger5KeepAliveTimeout
access_file_nameString.htaccessAccess filename
envvars_additional_paramsHash{}Hash of additional environment variables to add to the envvars file
sysconfig_additional_paramsHash{}Hash of additional sysconfig parameters to apply to the system
template_cookbookStringapache2Cookbook to source the apache2.conf template from

Examples

apache2_install 'custom' do
  status_url 'status.site.org'
  template_cookbook 'my_cookbook'
end
apache2_install 'default' do
  listen [ 80 ]
  mpm 'worker'
  mpm_conf(
           startservers: 10,
           serverlimit: 64,
           #maxclients    4096
           minsparethreads: 64,
           maxsparethreads: 256,
           threadsperchild: 64,
           #maxrequestsperchild 1024
           maxrequestworkers: 4096,
           maxconnectionsperchild: 1024
          )
  modules %w(status)
  mod_conf(
    status: {
      status_allow_list: %w(127.0.0.1 ::1 1.2.3.0/24),
      extended_status: 'On',
      proxy_status: 'Off'
    }
  )
  modules lazy { default_modules.delete_if { |x| x=='autoindex' } }
end
apache2_install 'overrides' do
  # override the values in _security.conf_
  server_signature 'EMail'
  server_tokens 'Full'
  trace_enable 'On'
  # override the values in _charset.conf_
  default_charset 'utf-8'
end