2019-06-11 22:24:35 +00:00
|
|
|
case node["platform_family"]
|
|
|
|
when "rhel"
|
|
|
|
apache_conf_dir = "httpd"
|
|
|
|
apache_conf_file = "conf/httpd.conf"
|
|
|
|
when "debian"
|
|
|
|
apache_conf_dir = "apache2"
|
|
|
|
apache_conf_file = "apache2.conf"
|
2017-03-14 03:48:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Create the apache configuration directory
|
|
|
|
directory "/etc/#{apache_conf_dir}"
|
|
|
|
|
|
|
|
# Create a directory for actual configuration /conf-available
|
|
|
|
directory "/etc/#{apache_conf_dir}/conf"
|
2016-02-01 16:18:33 +00:00
|
|
|
|
2017-03-14 03:48:19 +00:00
|
|
|
# Create a directory for actual configuration /conf-available
|
|
|
|
directory "/etc/#{apache_conf_dir}/conf-available"
|
2016-02-01 16:18:33 +00:00
|
|
|
|
2017-03-14 03:48:19 +00:00
|
|
|
# Create a directory for symlinked configuration /conf-enabled
|
|
|
|
directory "/etc/#{apache_conf_dir}/conf-enabled"
|
|
|
|
|
|
|
|
cookbook_file "/etc/#{apache_conf_dir}/#{apache_conf_file}" do
|
2019-06-11 22:24:35 +00:00
|
|
|
source "httpd.conf"
|
2017-03-14 03:48:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Create configuration file (not symlinked)
|
|
|
|
file "/etc/#{apache_conf_dir}/conf-enabled/maxkeepaliverequests.conf" do
|
2019-06-11 22:24:35 +00:00
|
|
|
content "MaxKeepAliveRequests 100"
|
2017-03-14 03:48:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Create configuration to be symlinked
|
|
|
|
file "/etc/#{apache_conf_dir}/conf-available/security.conf" do
|
2019-06-11 22:24:35 +00:00
|
|
|
content "ServerSignature Off"
|
2017-03-14 03:48:19 +00:00
|
|
|
end
|
2016-02-01 16:18:33 +00:00
|
|
|
|
2017-03-14 03:48:19 +00:00
|
|
|
# and link the configuration
|
|
|
|
link "/etc/#{apache_conf_dir}/conf-enabled/security.conf" do
|
|
|
|
to "/etc/#{apache_conf_dir}/conf-available/security.conf"
|
2016-02-01 16:18:33 +00:00
|
|
|
end
|