首页 > 其他 > 详细

lnmp+playbook+电商

时间:2019-12-27 17:25:41      阅读:92      评论:0      收藏:0      [点我收藏+]
---
   - hosts: webservers
     tasks:
       - name: ‘配置班级源‘
         script: repo.sh
       - name: ‘安装lnmp需要的插件‘
         yum: name=gcc,gcc-c++,unzip,pcre-devel,zlib-devel,php,php-mysql,php-gd,php-fpm,mysql,mysql-server state=latest
       - name: ‘解压nginx‘
         unarchive: src=nginx-1.16.1.tar.gz dest=/root/
       - name: ‘编译nginx‘
         shell: cd /root/nginx-1.16.1   && ./configure && make && make install
       - name: ‘传输配置文件‘
         copy: src=nginx.conf dest=/usr/local/nginx/conf/nginx.conf
         tags: change-nginx.conf
         notify: reload-nginx
       - name: ‘启动nginx‘
         shell: netstat -ntlp | grep -q nginx || /usr/local/nginx/sbin/nginx
       - name: ‘启动php-fpm‘
         service:  - name: ‘启动mysql‘
         service: name=mysqld state=started enabled=yes
       - name: ‘关闭防火墙‘
         service: name=iptables state=stopped
       - name: ‘关闭selinux‘
         shell: setenforce 0
       - name: ‘上线电商‘
         unarchive: src=tinyshopV2.5_data.zip  dest=/usr/local/nginx/html mode=777
       - name: ‘给主界面目录权限‘
         shell: chmod -R 777 /usr/local/nginx/html/
       - name: ‘创建用户‘
         user: name=tom createhome=no shell=/sbin/nologin
     handlers:
        - name: reload-nginx
          shell: /usr/local/nginx/sbin/nginx -s reload

  

lnmp+playbook+电商

原文:https://www.cnblogs.com/gaiting/p/12108113.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!