I'm trying to understand how to organize my Chef kitchen and extend the functionality of Opscode community cookbooks. Disclaimer: n00b.
PLANNED STACK
- Ubuntu 12.04.2
- Apache2 (package)
- PHP 5.4.13 (compiled)
- MySQL Server
- MySQL Client
APACHE COOKBOOK + COMPILED PHP
The Apache cookbook only offers a recipe for installing php as a package. The official Ubuntu 12.04 package installs PHP 5.3 and there is no good unofficial 5.4+ package. The application requires PHP 5.4+. Therefore, PHP must be compiled from source with the "--with-apxs2"
flag.
APXS
To compile PHP to work with Apache2 requires apxs2 (or apxs), which doesn't appear to be installed by the apache::default
recipe (even though apache2 -l
shows mod_so.c
and the apache docs seem to indicate that this indicates installation.)
- I did notice that line 142-143 of the default apache.conf.erb template has a commented out
LoadModule
line with something about "keeping apxs happy", but I didn't understand its purpose. Is there something simple I'm missing in the Apache2 docs that shows how to install or enable apxs? - The Apache cookbook doesn't offer a method for installing the
dev
package. So where should this installation occur? My 'sample_lamp_app' recipe? In a cookbook like 'my_apache2' that "extends" the community cookbook? The 'php::source' recipe, with anot_if
conditional that test for apxs?
NOTE
Please don't answer with things like "upgrade to Ubuntu 12.10" or "use this unofficial Apache2 cookbook instead". First, the project spec requires 12.04. Second I'm more interested in learning the proper methods for organizing and interacting within cookbooks.