cookbook 'rackspace_apache_php', '= 0.0.1'
rackspace_apache_php (10) Versions 0.0.1 Follow0
Installs/Configures rackspace_apache_php
cookbook 'rackspace_apache_php', '= 0.0.1', :supermarket
knife supermarket install rackspace_apache_php
knife supermarket download rackspace_apache_php
rackspace_apache_php-cookbook
A cookbook to provide a web server able to serve php pages with Apache and PHP fpm.
It relies on apache2 cookbook and php-fpm. Those cookbooks are pinned on wll know working minor version to prevent breaking changes.
Supported Platforms
- Centos 6.5
- Ubuntu 12.04
- Ubuntu 14.04
Attributes
node['rackspace_apache_php']['php_version']
: Which PHP version to install, default to PHP 5.6
node['rackspace_apache_php']['php_handler']['enable']
: Should it enable Apache PHP handler (applied in "conf.d", so it will be available in EVERY vhost, if you want to manage your own handler configuration, set this attribute to false)
node['rackspace_apache_php']['php_handler']['cookbook']
: Where to find the handler configuration , default to rackspace_apache_php cookbook
node['rackspace_apache_php']['php_handler']['template']
: Where to find the handler configuration , default to php-handler.conf.erb
Usage
Place a dependency on the rackspace_apache_php cookbook in your cookbook's metadata.rb
depends 'rackspace_apache_php'
Then, add rackspace_apache_php::default
to your runlist
# myrecipe.rb
include_recipe 'rackspace_apache_php::default'
or
# roles/myrole.rb
name "myrole"
description "apache and php role"
run_list(
"rackspace_apache_php::default"
)
You can change any of the apache2
and php-fpm
cookbook attributes to tune rackspace_apache_php configuration.
However you should not change ['php-fpm']['package_name']
or ['php-fpm']['service_name']
(as they are part of this cookbook logic) without checking it works.
In scope
The goal of this library is to do the basic configuration to serve PHP pages through Apache. It will only configure apache2
and the default php handler, users are free to configure their vhost if they need anything more specific.
More in details it :
- Installs and configure Apache2 web server
- Installs and configure php-fpm
- Configures Apache2 to serve php pages through php-fpm (in conf.d)
- gets the correct packages and change the configuration according to the php/apache version
Out of scope
Virtual Host are not managed by this cookbook, the configuration provided by this cookbook should not prevent users to extend php-fpm configuration. As many features as possible should have a flag to enable/disable them, it will allow to enjoy some parts of the work done by the library (get the correct packages by example) but still be able to configure your own php-fpm pools.
Examples
Apache and PHP 5.5
node.default['rackspace_apache_php']['php_handler']['enable'] = '5.5'
include_recipe 'rackspace_apache_php::default'
Apache and PHP 5.6
include_recipe 'rackspace_apache_php::default'
Apache and PHP 5.6 without default PHP handler
You will have to add your own Vhost to configure the handler, here is an example using a web_app
attribute to pass php-fpm default socket.
include_recipe 'rackspace_apache_php::default'
web_app "my_site" do
server_name node['hostname']
server_aliases [node['fqdn'], "my-site.example.com"]
docroot "/srv/www/my_site"
cookbook 'mycookbook'
php_socket '/var/run/php-fpm-www.sock'
end
References
Contributing
- Fork the repository on Github
- Create a named feature branch (i.e.
add-new-recipe
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request
License and Authors
Author:: Julien Berard (julien.berard@rackspace.com)
Dependent cookbooks
apache2 ~> 3.0 |
chef-sugar >= 0.0.0 |
php-fpm ~> 0.7 |
yum-ius >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
rackspace_apache_php CHANGELOG
0.0.1
- First version
Foodcritic Metric
0.0.1 failed this metric
FC031: Cookbook without metadata file: /tmp/cook/adc0a15815b2776e98de592d/rackspace_apache_php/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/adc0a15815b2776e98de592d/rackspace_apache_php/metadata.rb:1
0.0.1 failed this metric
FC045: Consider setting cookbook name in metadata: /tmp/cook/adc0a15815b2776e98de592d/rackspace_apache_php/metadata.rb:1