Cookbooks
apache2
documentation
Resource Apache2 Default Site

apache2_default_site

Back to resource list

Controls the default site.

Properties

NameTypeDefaultDescription
default_site_nameStringdefault-siteThe default site name
site_actionString, Symbol:enableEnable the site. Allows you to place all the configuration on disk but not enable the site
portString80Listen port
template_cookbookStringapache2Cookbook to source the template file from
server_adminStringroot@localhostDefault site contact name
log_levelStringwarnLog level for apache2
log_dirStringdefault_log_dirDefaults to platform specific locations, see libraries/helpers.rb
docroot_dirStringdefault_docroot_dirApache document root. Defaults to platform specific locations, see libraries/helpers.rb
apache_root_groupStringnode['root_group']Group that the root user on the box runs as. Defaults to platform specific value from ohai root_group
template_sourceStringdefault_site_template_sourceSource for the template. Defaults to #{new_resource.default_site_name}.conf on Debian flavours and welcome.conf on all other platforms
variablesHash{}A hash of variables to pass into the template

Actions

  • :enable
  • :disable

Examples

apache2_default_site '' do
  default_site_name String
  site_action       [String, Symbol]
  port              String
  template_cookbook String
  server_admin      String
  log_level         String
  action :enable
end
apache2_default_site 'config-with-variables' do
  default_site_name 'example'
  site_action       :enable
  port              443
  template_cookbook 'my_cookbook'
  template_source   'ssl-enabled.conf.erb'
  server_admin      'webmaster@example.com'
  variables(
    ssl_cert_file: "#{apache_dir}/ssl/server.crt",
    ssl_cert_key_file: "#{apache_dir}/ssl/server.key",
  )
  action :enable
end