Skip to content

Commit

Permalink
Import apache2 version 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
xdissent committed Dec 18, 2011
1 parent f91bef8 commit af262d0
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 35 deletions.
8 changes: 8 additions & 0 deletions cookbooks/apache2/README.md
Expand Up @@ -295,6 +295,14 @@ For examples of using the definitions in your own recipes, see their respective
Changes
=======

## v1.0.4:

* [COOK-859] - don't hardcode module paths

## v1.0.2

* Tickets resolved in this release: COOK-788, COOK-782, COOK-780

## v1.0.0

* Red Hat family support is greatly improved, all recipes except `god_monitor` converge.
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/apache2/attributes/default.rb
Expand Up @@ -32,7 +32,7 @@
else
set[:apache][:pid_file] = "/var/run/httpd.pid"
end
set[:apache][:lib_dir] = node[:kernel][:machine] == "i386" ? "/usr/lib/httpd" : "/usr/lib64/httpd"
set[:apache][:lib_dir] = node[:kernel][:machine] =~ /^i[36]86$/ ? "/usr/lib/httpd" : "/usr/lib64/httpd"
when "debian","ubuntu"
set[:apache][:dir] = "/etc/apache2"
set[:apache][:log_dir] = "/var/log/apache2"
Expand Down
3 changes: 2 additions & 1 deletion cookbooks/apache2/definitions/apache_module.rb
Expand Up @@ -21,14 +21,15 @@
include_recipe "apache2"

params[:filename] = params[:filename] || "mod_#{params[:name]}.so"
params[:module_path] = params[:module_path] || "#{node['apache']['lib_dir']}/modules/#{params[:filename]}"

if params[:conf]
apache_conf params[:name]
end

if platform?("redhat", "centos", "scientific", "fedora", "arch", "suse" )
file "#{node['apache']['dir']}/mods-available/#{params[:name]}.load" do
content "LoadModule #{params[:name]}_module #{node['apache']['lib_dir']}/modules/#{params[:filename]}\n"
content "LoadModule #{params[:name]}_module #{params[:module_path]}\n"
mode 0644
end
end
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/apache2/metadata.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cookbooks/apache2/metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs and configures all aspects of apache2 using Debian style symlinks with helper definitions"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.0"
version "1.0.4"
recipe "apache2", "Main Apache configuration"
recipe "apache2::mod_alias", "Apache module 'alias' with config file"
recipe "apache2::mod_auth_basic", "Apache module 'auth_basic'"
Expand Down
46 changes: 23 additions & 23 deletions cookbooks/apache2/recipes/default.rb
Expand Up @@ -70,15 +70,15 @@
cookbook_file "/usr/local/bin/apache2_module_conf_generate.pl" do
source "apache2_module_conf_generate.pl"
mode 0755
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
end

%w{sites-available sites-enabled mods-available mods-enabled}.each do |dir|
directory "#{node[:apache][:dir]}/#{dir}" do
mode 0755
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
action :create
end
end
Expand All @@ -97,8 +97,8 @@
template "/usr/sbin/#{modscript}" do
source "#{modscript}.erb"
mode 0755
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
end
end

Expand All @@ -120,22 +120,22 @@
directory "#{node[:apache][:dir]}/ssl" do
action :create
mode 0755
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
end

directory "#{node[:apache][:dir]}/conf.d" do
action :create
mode 0755
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
end

directory node[:apache][:cache_dir] do
action :create
mode 0755
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
end

template "apache2.conf" do
Expand All @@ -146,17 +146,17 @@
path "#{node[:apache][:dir]}/apache2.conf"
end
source "apache2.conf.erb"
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
mode 0644
notifies :restart, resources(:service => "apache2")
end

template "security" do
path "#{node[:apache][:dir]}/conf.d/security"
source "security.erb"
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
mode 0644
backup false
notifies :restart, resources(:service => "apache2")
Expand All @@ -165,26 +165,26 @@
template "charset" do
path "#{node[:apache][:dir]}/conf.d/charset"
source "charset.erb"
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
mode 0644
backup false
notifies :restart, resources(:service => "apache2")
end

template "#{node[:apache][:dir]}/ports.conf" do
source "ports.conf.erb"
owner node[:apache][:user]
group node[:apache][:group]
variables :apache_listen_ports => node[:apache][:listen_ports]
owner "root"
group "root"
variables :apache_listen_ports => node[:apache][:listen_ports].map{|p| p.to_i}.uniq
mode 0644
notifies :restart, resources(:service => "apache2")
end

template "#{node[:apache][:dir]}/sites-available/default" do
source "default-site.erb"
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
mode 0644
notifies :restart, resources(:service => "apache2")
end
Expand Down
11 changes: 6 additions & 5 deletions cookbooks/apache2/recipes/mod_auth_openid.rb
Expand Up @@ -79,14 +79,15 @@
end

file "#{node[:apache][:cache_dir]}/mod_auth_openid.db" do
owner node[:apache][:user]
owner "root"
group node[:apache][:group]
mode 0640
end

template "#{node[:apache][:dir]}/mods-available/authopenid.load" do
source "mods/authopenid.load.erb"
owner node[:apache][:user]
group node[:apache][:group]
owner "root"
group "root"
mode 0644
end

Expand All @@ -96,7 +97,7 @@

template "/usr/local/bin/mod_auth_openid.rb" do
source "mod_auth_openid.rb.erb"
owner node[:apache][:user]
group node[:apache][:user]
owner "root"
group node[:apache][:group]
mode 0750
end
2 changes: 1 addition & 1 deletion cookbooks/apache2/recipes/mod_ssl.rb
Expand Up @@ -33,7 +33,7 @@

template "#{node[:apache][:dir]}/ports.conf" do
source "ports.conf.erb"
variables :apache_listen_ports => ports
variables :apache_listen_ports => ports.map{|p| p.to_i}.uniq
notifies :restart, resources(:service => "apache2")
mode 0644
end
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/apache2/templates/default/apache2.conf.erb
Expand Up @@ -80,7 +80,7 @@ KeepAliveTimeout <%= node[:apache][:keepalivetimeout] %>
</IfModule>

User <%= node[:apache][:user] %>
Group <%= node[:apache][:user] %>
Group <%= node[:apache][:group] %>

#
# AccessFileName: The name of the file to look for in each directory
Expand Down

0 comments on commit af262d0

Please sign in to comment.