• lnmp+playbook+电商


    ---
       - 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
    

      

  • 相关阅读:
    el-checkbox
    文件上传优化
    二叉树的建立
    二叉树的遍历算法
    两个二进制数多少个位(bit)不同
    二维矩阵置零
    search-a-2d-matrix(二维矩阵查找)
    Ubuntu16.04安装配置Eclipse 以及opencv的使用
    树莓派 自身摄像头的opencv调用
    树莓派3上安装Qt5
  • 原文地址:https://www.cnblogs.com/gaiting/p/12108113.html
Copyright © 2020-2023  润新知