GithubHelp home page GithubHelp logo

mikevo / ansible-role-apache-php-fpm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geerlingguy/ansible-role-apache-php-fpm

0.0 0.0 0.0 38 KB

Apache FastCGI support for PHP-FPM

Home Page: https://galaxy.ansible.com/geerlingguy/apache-php-fpm/

License: MIT License

ansible-role-apache-php-fpm's Introduction

Ansible Role: Apache PHP-FPM

CI

An Ansible Role that configures Apache for PHP-FPM usage on RHEL/CentOS and Debian/Ubuntu.

Requirements

This role is dependent upon geerlingguy.apache, and also requires you have PHP running with PHP-FPM somewhere on the server or elsewhere (I usually configure PHP with the geerlingguy.php role).

When configuring your Apache virtual hosts, you can add the following line to any vhost definition to enable passthrough to PHP-FPM:

# If using a TCP port:
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/example"

# If using a Unix socket:
ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://localhost/var/www/example"

For a full usage example with the geerlingguy.apache role, see the Example Playbook later in this README.

RedHat 6 and 7

RedHat/CentOS 7 automatically installs and enables mod_proxy_fcgi by default.

RedHat/CentOS 6 installs Apache 2.2, and is much harder to get configured with FastCGI, but here are two guides in case you need to support this use case:

Role Variables

None.

Dependencies

None.

Example Playbook

- hosts: webservers

  vars:
    php_enable_php_fpm: true
    apache_vhosts:
      - servername: "www.example.com"
        documentroot: "/var/www/example"
        extra_parameters: |
              ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/example"

  roles:
    - geerlingguy.apache
    - geerlingguy.php
    - geerlingguy.apache-php-fpm

License

MIT / BSD

Author Information

This role was created in 2016 by Jeff Geerling, author of Ansible for DevOps.

ansible-role-apache-php-fpm's People

Contributors

aurelijusrozenas avatar geerlingguy 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.