geerlingguy.apache-php-fpm
Ansible 角色: Apache PHP-FPM
这是一个配置 Apache 以在 RHEL/CentOS 和 Debian/Ubuntu 上使用 PHP-FPM 的 Ansible 角色。
要求
这个角色依赖于 geerlingguy.apache
,还需要在服务器或其他地方运行 PHP-FPM(我通常使用 geerlingguy.php
角色来配置 PHP)。
在配置 Apache 虚拟主机时,您可以在任何虚拟主机定义中添加以下行以启用对 PHP-FPM 的传递:
# 如果使用 TCP 端口:
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/example"
# 如果使用 Unix 套接字:
ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://localhost/var/www/example"
有关与 geerlingguy.apache
角色的完整使用示例,请参见本 README 后面的示例剧本。
RedHat 6 和 7
RedHat/CentOS 7 默认自动安装并启用 mod_proxy_fcgi。
RedHat/CentOS 6 安装的是 Apache 2.2,配置 FastCGI 要困难得多,但这里有两个指南以防您需要支持此用例:
角色变量
无。
依赖项
无。
示例剧本
- 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
许可证
MIT / BSD
作者信息
这个角色由 Jeff Geerling 于 2016 年创建,他是 Ansible for DevOps 的作者。
安装
ansible-galaxy install geerlingguy.apache-php-fpm
许可证
mit
下载
557k
拥有者
Father, author, developer, maker. Sometimes called "an inflammatory enigma". #stl #drupal #ansible #k8s #raspberrypi #crohns