Permalink
Browse files

Merge branch 'ESPRINT-355'

  • Loading branch information...
jtimberman committed Sep 13, 2011
2 parents bb02f20 + 545e48a commit 90aedf7692425d57f18bf885aac7cf8fc4853d53
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.
@@ -19,34 +19,50 @@
# Where the various parts of apache are
case platform
when "redhat","centos","fedora","suse"
when "redhat","centos","scientific","fedora","suse"
set[:apache][:dir] = "/etc/httpd"
set[:apache][:log_dir] = "/var/log/httpd"
set[:apache][:user] = "apache"
set[:apache][:group] = "apache"
set[:apache][:binary] = "/usr/sbin/httpd"
set[:apache][:icondir] = "/var/www/icons/"
set[:apache][:cache_dir] = "/var/cache/httpd"
if node.platform_version.to_f >= 6 then
set[:apache][:pid_file] = "/var/run/httpd/httpd.pid"
else
set[:apache][:pid_file] = "/var/run/httpd.pid"
end
set[:apache][:lib_dir] = node[:kernel][:machine] == "i386" ? "/usr/lib/httpd" : "/usr/lib64/httpd"
when "debian","ubuntu"
set[:apache][:dir] = "/etc/apache2"
set[:apache][:log_dir] = "/var/log/apache2"
set[:apache][:user] = "www-data"
set[:apache][:group] = "www-data"
set[:apache][:binary] = "/usr/sbin/apache2"
set[:apache][:icondir] = "/usr/share/apache2/icons"
set[:apache][:cache_dir] = "/var/cache/apache2"
set[:apache][:pid_file] = "/var/run/apache2.pid"
set[:apache][:lib_dir] = "/usr/lib/apache2"
when "arch"
set[:apache][:dir] = "/etc/httpd"
set[:apache][:log_dir] = "/var/log/httpd"
set[:apache][:user] = "http"
set[:apache][:group] = "http"
set[:apache][:binary] = "/usr/sbin/httpd"
set[:apache][:icondir] = "/usr/share/httpd/icons"
set[:apache][:cache_dir] = "/var/cache/httpd"
set[:apache][:pid_file] = "/var/run/httpd/httpd.pid"
set[:apache][:lib_dir] = "/usr/lib/httpd"
else
set[:apache][:dir] = "/etc/apache2"
set[:apache][:log_dir] = "/var/log/apache2"
set[:apache][:user] = "www-data"
set[:apache][:group] = "www-data"
set[:apache][:binary] = "/usr/sbin/apache2"
set[:apache][:icondir] = "/usr/share/apache2/icons"
set[:apache][:cache_dir] = "/var/cache/apache2"
set[:apache][:pid_file] = "logs/httpd.pid"
set[:apache][:lib_dir] = "/usr/lib/apache2"
end
###
@@ -19,11 +19,20 @@
define :apache_module, :enable => true, :conf => false do
include_recipe "apache2"
params[:filename] = params[:filename] || "mod_#{params[:name]}.so"
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"
mode 0644
end
end
if params[:enable]
execute "a2enmod #{params[:name]}" do
command "/usr/sbin/a2enmod #{params[:name]}"
@@ -32,7 +41,7 @@
((File.exists?("#{node[:apache][:dir]}/mods-available/#{params[:name]}.conf"))?
(File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.conf")):(true)))
end
end
end
else
execute "a2dismod #{params[:name]}" do
command "/usr/sbin/a2dismod #{params[:name]}"
@@ -19,12 +19,12 @@
define :apache_site, :enable => true do
include_recipe "apache2"
if params[:enable]
execute "a2ensite #{params[:name]}" do
command "/usr/sbin/a2ensite #{params[:name]}"
notifies :restart, resources(:service => "apache2")
not_if do
not_if do
::File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") or
::File.symlink?("#{node[:apache][:dir]}/sites-enabled/000-#{params[:name]}")
end
@@ -34,7 +34,10 @@
execute "a2dissite #{params[:name]}" do
command "/usr/sbin/a2dissite #{params[:name]}"
notifies :restart, resources(:service => "apache2")
only_if do ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") end
only_if do
::File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") or
::File.symlink?("#{node[:apache][:dir]}/sites-enabled/000-#{params[:name]}")
end
end
end
end
@@ -17,7 +17,7 @@
# limitations under the License.
#
define :web_app, :template => "web_app.conf.erb" do
define :web_app, :template => "web_app.conf.erb", :enable => true do
application_name = params[:name]
@@ -44,6 +44,6 @@
end
apache_site "#{params[:name]}.conf" do
enable enable_setting
enable params[:enable]
end
end
View
@@ -2,7 +2,7 @@
maintainer_email "cookbooks@opscode.com"
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.rdoc'))
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.99.4"
recipe "apache2", "Main Apache configuration"
recipe "apache2::mod_alias", "Apache module 'alias' with config file"
Oops, something went wrong.

0 comments on commit 90aedf7

Please sign in to comment.