[chef] Re: Re: Re: Re: Re: Re: Re: Is this a bug in the apache2 cookbook?


Chronological Thread 
  • From: Matthew Moretti < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Re: Re: Is this a bug in the apache2 cookbook?
  • Date: Mon, 9 Jan 2012 22:42:43 -0500

The Apache cookbook doesn't need to create .load files for nearly all modules because the Debian-based distros package one with the module.

Typically, you would install -- for example -- mod_perl with a "package" resource.  This ends up being more-or-less equivalent to running "apt-get install libapache2-mod-perl2" on the host.  For every Apache module I've ever installed (on Ubuntu), that results in the creation of .load file and, sometimes, a .conf file in /etc/apache2/mods-available/

Now, because the .conf file contains configuration, you'll probably want to manage its contents with Chef, but we can rely on the .load file being there on any Debian-based distro (hence why it's only explicitly created on the non-Debian-based ones).

Passenger is a little different, as it is built from source by a rubygem.  In my opinion, there is a bug with the current version of the passenger_apache2 cookbook.  It tries to rely on the .load file creating ability of the apache_module definition which (as you've found) won't work on Ubuntu or Debian.  This looks to be a recent change in the cookbook.

Of course, the apache2 cookbook could just always create the .load file regardless of distribution.  However, for all cases except passenger it would be redundant and might introduce other issues.

In any case, if you believe you've found a bug in an Opscode cookbook, you should report it.

Good luck

-Matt Moretti

On Mon, Jan 9, 2012 at 9:49 PM, Tim Uckun < "> > wrote:
On Tue, Jan 10, 2012 at 10:36 AM, Tim Uckun < "> > wrote:
>> Yes, the fault is with the passenger_apache2 recipe.
>>

I have just been looking at this and I really think this is a problem
with the apache2 recipe and not the passenger recipe.  Here is the
flow.

The passenger recipe creates the module and does the following.


include_recipe "passenger_apache2"

template "#{node[:apache][:dir]}/mods-available/passenger.conf" do
 cookbook "passenger_apache2"
 source "passenger.conf.erb"
 owner "root"
 group "root"
 mode "644"
end

apache_module "passenger" do
 module_path node[:passenger][:module_path]
end

As you can see from above it is asking the apache_module provider
(defined in the apache2 recipe) to create a module for it. The
apache_module recipe looks like this.

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 #{params[:module_path]}\n"
     mode 0644
   end
 end

So it refuses to create the .load file unless the platform matches the
ones listed.

I can see no rational reason for this. How is apache supposed to load
the module without a LoadModule directive?

It seems to me that the passenger recipe is doing the right thing. In
fact from the looks of it it could just pass the config params to
apache_module too instead of creating it's own .conf file.

So at this stage I have the following options.

1. Change the apache recipe and add ubuntu and debian to the list.
2. Change the passenger recipe to create the load file
3. create the load file outside of either one of these recipes.




Archive powered by MHonArc 2.6.16.

§