Giter Club home page Giter Club logo

cookbook-php-fpm's Introduction

Description

Installs and configures PHP-FPM (FastCGI Process Manager), an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. It's like the unicorn of the PHP world dawg.

Requirements

Platform

  • Debian, Ubuntu
  • CentOS, Red Hat, Fedora
  • Amazon Linux

Cookbooks

  • apt (leverages apt_repository LWRP)
  • yum (leverages yum_repository LWRP)

The apt_repository and yum_repository LWRPs are used from these cookbooks to create the proper repository entries so the php-fpm package downloaded and installed.

Description

Creates a PHP-FPM configuration file at the path specified. Meant to be deployed with a service init scheme/supervisor such as runit. Please see the application::php-fpm recipe for a complete working example. In depth information about PHP-FPM's configuration values can be found in the PHP-FPM documentation.

Usage

Simply include the recipe where you want PHP-FPM installed. Default pool www will be created. To disable pool creation set default['php-fpm']['pools'] to false.

To customize settings and pools you can override default attributes.

Usage in roles:

name "php-fpm"
description "php fpm role"
run_list "recipe[php-fpm]"
override_attributes "php-fpm" => {
	"pools" => [
		{
			:name => "default"
		},
		{
			:name => "www",
			:cookbook => "another-cookbook",
			:process_manager => "dynamic",
			:max_requests => 5000,
			:php_options => { 'php_admin_flag[log_errors]' => 'on', 'php_admin_value[memory_limit]' => '32M' }
		}
	]
}

Creating pools in recipes

Create PHP-FPM pool named 'www' with default settings:

php_fpm_pool "www"

Create PHP-FPM pool named 'www' with custom settings:

php_fpm_pool "www" do
  cookbook "another-cookbook" # get template from another cookbook
  process_manager "dynamic"
  max_requests 5000
  php_options 'php_admin_flag[log_errors]' => 'on', 'php_admin_value[memory_limit]' => '32M'
end

Delete PHP-FPM pool named 'www':

php_fpm_pool "www" do
  enable false
end

License and Author

Author:: Seth Chisamore ([email protected])

Copyright:: 2011, Opscode, Inc

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

cookbook-php-fpm's People

Contributors

ameir avatar benlemasurier avatar dzydzany avatar fxposter avatar ianneub avatar jahkeup avatar jbasko avatar krivospitsky avatar llonchj avatar luishdez avatar mal avatar poppen avatar spinx avatar yevgenko avatar zuazo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.