Skip to content

Commit f8e070c

Browse files
committed
Remove Apache 2.2 support
Signed-off-by: Tim Smith <tsmith@chef.io>
1 parent 07ef6c9 commit f8e070c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+21
-399
lines changed

.kitchen.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ platforms:
1212
- name: amazonlinux
1313
driver_config:
1414
box: mvbcoding/awslinux
15-
- name: centos-6.9
1615
- name: centos-7.3
1716
- name: debian-7.11
1817
- name: debian-8.8

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ In order to support the broadest number of platforms, several attributes are det
116116

117117
These are general settings used in recipes and templates. Default values are noted.
118118

119-
- `node['apache']['version']` - Specifing 2.4 triggers apache 2.4 support. If the platform is known during our test to install 2.4 by default, it will be set to 2.4 for you. Otherwise it falls back to 2.2\. This value should be specified as a string.
120119
- `node['apache']['listen']` - Array of address:port combinations that httpd should listen on. Default is any address and port 80 (`["*:80"]`).
121120
- `node['apache']['contact']` - Value for ServerAdmin directive. Default "ops@example.com".
122121
- `node['apache']['timeout']` - Value for the Timeout directive. Default is 300.

attributes/default.rb

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,6 @@
2828
'prefork'
2929
end
3030

31-
default['apache']['version'] =
32-
case node['platform_family']
33-
when 'debian'
34-
case node['platform']
35-
when 'debian', 'raspbian'
36-
node['platform_version'].to_f >= 8.0 ? '2.4' : '2.2'
37-
else
38-
'2.4'
39-
end
40-
when 'rhel'
41-
case node['platform']
42-
when 'amazon' # This is for chef 12 compatibility
43-
'2.4'
44-
else
45-
node['platform_version'].to_f >= 7.0 ? '2.4' : '2.2'
46-
end
47-
when 'suse'
48-
node['platform_version'].to_f >= 12.1 ? '2.4' : '2.2'
49-
else
50-
'2.4'
51-
end
52-
5331
default['apache']['root_group'] = 'root'
5432
default['apache']['default_site_name'] = 'default'
5533

@@ -76,12 +54,7 @@
7654
default['apache']['conf_dir'] = '/etc/httpd/conf'
7755
default['apache']['docroot_dir'] = '/var/www/html'
7856
default['apache']['cgibin_dir'] = '/var/www/cgi-bin'
79-
default['apache']['icondir'] =
80-
if node['apache']['version'] == '2.4'
81-
'/usr/share/httpd/icons'
82-
else
83-
'/var/www/icons'
84-
end
57+
default['apache']['icondir'] = '/usr/share/httpd/icons'
8558
default['apache']['cache_dir'] = '/var/cache/httpd'
8659
default['apache']['run_dir'] = '/var/run/httpd'
8760
default['apache']['lock_dir'] = '/var/run/httpd'
@@ -107,12 +80,7 @@
10780
default['apache']['cache_dir'] = '/var/cache/apache2'
10881
default['apache']['run_dir'] = '/var/run/httpd'
10982
default['apache']['lock_dir'] = '/var/run/httpd'
110-
default['apache']['pid_file'] =
111-
if node['platform_version'].to_f > 11.4
112-
'/var/run/httpd.pid'
113-
else
114-
'/var/run/httpd2.pid'
115-
end
83+
default['apache']['pid_file'] = '/var/run/httpd2.pid'
11684
default['apache']['lib_dir'] = node['kernel']['machine'] =~ /^i[36]86$/ ? '/usr/lib/apache2' : '/usr/lib64/apache2'
11785
default['apache']['libexec_dir'] = node['apache']['lib_dir']
11886
when 'debian'
@@ -138,14 +106,8 @@
138106
default['apache']['cache_dir'] = '/var/cache/apache2'
139107
default['apache']['run_dir'] = '/var/run/apache2'
140108
default['apache']['lock_dir'] = '/var/lock/apache2'
141-
# this should use COOK-3917 to educate the initscript of the pid location
142-
if node['apache']['version'] == '2.4'
143-
default['apache']['pid_file'] = '/var/run/apache2/apache2.pid'
144-
default['apache']['docroot_dir'] = '/var/www/html'
145-
else
146-
default['apache']['pid_file'] = '/var/run/apache2.pid'
147-
default['apache']['docroot_dir'] = '/var/www'
148-
end
109+
default['apache']['pid_file'] = '/var/run/apache2/apache2.pid'
110+
default['apache']['docroot_dir'] = '/var/www/html'
149111
default['apache']['lib_dir'] = '/usr/lib/apache2'
150112
default['apache']['build_dir'] = '/usr/share/apache2'
151113
default['apache']['libexec_dir'] = "#{node['apache']['lib_dir']}/modules"
@@ -301,16 +263,10 @@
301263
authz_host authz_user autoindex deflate dir env mime negotiation setenvif
302264
)
303265

304-
%w(log_config logio).each do |log_mod|
266+
%w(log_config logio unixd).each do |log_mod|
305267
default['apache']['default_modules'] << log_mod if %w(rhel amazon fedora suse arch freebsd).include?(node['platform_family'])
306268
end
307269

308-
if node['apache']['version'] == '2.4'
309-
%w(unixd).each do |unix_mod|
310-
default['apache']['default_modules'] << unix_mod if %w(rhel amazon fedora suse arch freebsd).include?(node['platform_family'])
311-
end
312-
313-
unless node['platform'] == 'amazon' # This is for chef 12 compatibility
314-
default['apache']['default_modules'] << 'systemd' if %w(rhel fedora).include?(node['platform_family'])
315-
end
270+
unless node['platform'] == 'amazon' # This is for chef 12 compatibility
271+
default['apache']['default_modules'] << 'systemd' if %w(rhel fedora).include?(node['platform_family'])
316272
end

recipes/default.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,11 @@
176176
conf_path node['apache']['dir']
177177
end
178178

179-
if node['apache']['version'] == '2.4'
180179
if node['apache']['mpm_support'].include?(node['apache']['mpm'])
181180
include_recipe "apache2::mpm_#{node['apache']['mpm']}"
182181
else
183182
Chef::Log.warn("apache2: #{node['apache']['mpm']} module is not supported and must be handled separately!")
184183
end
185-
end
186184

187185
node['apache']['default_modules'].each do |mod|
188186
module_recipe_name = mod =~ /^mod_/ ? mod : "mod_#{mod}"
@@ -200,15 +198,6 @@
200198

201199
service 'apache2' do
202200
service_name apache_service_name
203-
case node['platform_family']
204-
when 'rhel'
205-
if node['platform_version'].to_f < 7.0 && node['apache']['version'] != '2.4'
206-
restart_command "/sbin/service #{apache_service_name} restart && sleep 1"
207-
reload_command "/sbin/service #{apache_service_name} graceful && sleep 1"
208-
end
209-
when 'debian'
210-
provider Chef::Provider::Service::Debian
211-
end
212201
supports [:start, :restart, :reload, :status]
213202
action [:enable, :start]
214203
only_if "#{node['apache']['binary']} -t", environment: { 'APACHE_LOG_DIR' => node['apache']['log_dir'] }, timeout: 10

recipes/mod_authn_core.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,5 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818
#
19-
if node['apache']['version'] == '2.4'
20-
apache_module 'authn_core'
21-
else
22-
Chef::Log.info('Ignoring apache2::mod_authn_core. not available until apache 2.4')
23-
end
19+
20+
apache_module 'authn_core'

recipes/mod_authz_core.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,4 @@
1717
# limitations under the License.
1818
#
1919

20-
if node['apache']['version'] == '2.4'
21-
apache_module 'authz_core'
22-
else
23-
apache_module 'authz_default'
24-
end
20+
apache_module 'authz_core'

recipes/mod_fcgid.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,6 @@
2828
content '# conf is under mods-available/fcgid.conf - apache2 cookbook\n'
2929
only_if { ::Dir.exist?("#{node['apache']['dir']}/conf.d") }
3030
end
31-
32-
# CentOS 7 (and recent Fedoras) have Apache 2.4, where FCGI socket path
33-
# and shared memory path is managed adequately without further involvment
34-
# neccessary (subdirectory is created under /var/run/httpd).
35-
#
36-
# However, when the path is specified manually, that subdirectory is NOT
37-
# created automatically if it doesn't already exist and Apache fails to
38-
# start. Since in recent RHEL systems /var/run is on tmpfs, end result is
39-
# that chef-created subdirectory disappears on shutdown, and Apache fails
40-
# to start after server reboot. Best to leave out these two settings
41-
# unset then.
42-
if (node['platform_family'] == 'rhel') && (node['platform_version'].to_i == 6)
43-
directory '/var/run/httpd/mod_fcgid' do
44-
owner node['apache']['user']
45-
group node['apache']['group']
46-
recursive true
47-
end
48-
end
49-
5031
elsif platform_family?('suse')
5132
apache_lib_path = node['apache']['lib_dir']
5233

recipes/mod_ldap.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
# limitations under the License.
1818
#
1919

20-
if platform_family?('rhel', 'fedora', 'amazon') && node['apache']['version'] == '2.4'
21-
package 'mod_ldap'
22-
end
20+
package 'mod_ldap'
2321

2422
apache_module 'ldap' do
2523
conf true

recipes/mod_privileges.rb

Lines changed: 0 additions & 26 deletions
This file was deleted.

recipes/mod_proxy_balancer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# limitations under the License.
1919
#
2020

21-
if !platform_family?('freebsd') && node['apache']['version'] == '2.4'
21+
if !platform_family?('freebsd')
2222
include_recipe 'apache2::mod_slotmem_shm'
2323
end
2424

0 commit comments

Comments
 (0)