- Security Automation with Ansible 2
- Madhu Akula Akash Mahajan
- 141字
- 2021-07-02 21:59:59
Installing PHP for WordPress setup
The following code snippet uses different modules to perform the installation of PHP and other required packages. Then it updates the PHP-FPM configuration using the replace module. Finally, it also updates the nginx configuration to update the PHP-FPM processing using the template module, and restarts the service to apply the changes:
- name: installing php
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- php
- php-curl
- php-fpm
- php-mysql
- php-xmlrpc
- name: configuring php.ini for php processor
replace:
path: /etc/php5/fpm/php.ini
regex: ';cgi.fix_pathinfo=1'
replace: 'cgi.fix_pathinfo=0'
backup: yes
- name: enable and restart the php fpm service
service:
name: php7.0-fpm
enabled: yes
state: restarted
- name: update the nginx configuration to support php-fpm
template:
src: "{{ item.src }}"
dest: "{{ item.dst }}"
with_items:
- { src: "defautlt.conf.j2", dst: "/etc/nginx/conf.d/default.conf" }
- name: restart the nginx
service:
state: restarted
name: nginx
推薦閱讀
- 集成架構(gòu)中型系統(tǒng)
- 自動(dòng)控制工程設(shè)計(jì)入門
- 21天學(xué)通JavaScript
- 網(wǎng)絡(luò)服務(wù)器架設(shè)(Windows Server+Linux Server)
- Java實(shí)用組件集
- 輕松學(xué)Java
- 21天學(xué)通C++
- Python Data Science Essentials
- Hands-On Data Warehousing with Azure Data Factory
- 計(jì)算機(jī)組成與操作系統(tǒng)
- Web璀璨:Silverlight應(yīng)用技術(shù)完全指南
- C#編程兵書
- 數(shù)據(jù)清洗
- 網(wǎng)管員世界2009超值精華本
- 系統(tǒng)安裝、維護(hù)與數(shù)據(jù)備份技巧