- 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
推薦閱讀
- ArchiCAD 19:The Definitive Guide
- Big Data Analytics with Hadoop 3
- Managing Mission:Critical Domains and DNS
- 并行數(shù)據(jù)挖掘及性能優(yōu)化:關(guān)聯(lián)規(guī)則與數(shù)據(jù)相關(guān)性分析
- The Python Workshop
- Chef:Powerful Infrastructure Automation
- 教育機(jī)器人的風(fēng)口:全球發(fā)展現(xiàn)狀及趨勢(shì)
- Applied Data Visualization with R and ggplot2
- Mastering Predictive Analytics with scikit:learn and TensorFlow
- 基于Proteus的PIC單片機(jī)C語(yǔ)言程序設(shè)計(jì)與仿真
- PHP求職寶典
- Arduino創(chuàng)意機(jī)器人入門(mén):基于ArduBlock(第2版)
- 運(yùn)動(dòng)控制器及數(shù)控系統(tǒng)的工程應(yīng)用
- 傳感器與檢測(cè)技術(shù)
- 單片機(jī)C語(yǔ)言編程實(shí)踐