ansible源码安装php,部署论坛

  • hosts: web
    remote_user: root
    tasks:
    • name: yum
      yum: name=gcc,gcc-c++,gd,libjpeg-devel,libpng-devel,zlib-devel,openssl-devel,pcre-devel,libxml2-devel
    • name: unarchive
      unarchive: src=/root/php-7.2.0.tar.gz dest=/root/
    • name: shell configure
      shell: ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --enable-mbstring --with-gd --with-zlib --with-jpeg-dir=/usr/lib --enable-fpm && make && make install
      args:
      chdir: /root/php-7.2.0
    • name: copy php.ini
      copy: src=/root/php-7.2.0/php.ini-development dest=/usr/local/php/php.ini remote_src=yes
    • name: replace
      replace: path=/usr/local/php/php.ini regexp=‘short_open_tag = Off’ replace=‘short_open_tag = On’
    • name: copy php-fpm
      copy: src=/root/php-7.2.0/sapi/fpm/init.d.php-fpm dest=/etc/init.d/php-fpm remote_src=yes
    • name: file modify the properties
      file: path=/etc/init.d/php-fpm mode=0755 state=file
    • name: copy php-fpm.conf
      copy: src=/usr/local/php/etc/php-fpm.conf.default dest=/usr/local/php/etc/php-fpm.conf remote_src=yes
    • name: replace
      replace: path=/usr/local/php/etc/php-fpm.conf regexp=’;pid = run/php-fpm.pid’ replace=‘pid = run/php-fpm.pid’
    • name: replace
      replace: path=/usr/local/php/etc/php-fpm.conf regexp=’;emergency_restart_interval = 10’ replace=‘emergency_restart_interval = 20s’
    • name: replace
      replace: path=/usr/local/php/etc/php-fpm.conf regexp=’;error_log = log/php-fpm.log’ replace=‘error_log = log/php-fpm.log’
    • name: replace
      replace: path=/usr/local/php/etc/php-fpm.conf regexp=’;emergency_restart_threshold = 0’ replace=‘emergency_restart_threshold = 10’
    • name: replace
      replace: path=/usr/local/php/etc/php-fpm.conf regexp=’;process.max = 128’ replace=‘process.max = 128’
    • name: replace
      replace: path=/usr/local/php/etc/php-fpm.conf regexp=’;rlimit_files = 1024’ replace=‘rlimit_files = 1024’
    • name: replace
      replace: path=/usr/local/php/etc/php-fpm.conf regexp=’;events.mechanism = epoll’ replace=‘events.mechanism = epoll’
    • name: copy www.conf
      copy: src=/usr/local/php/etc/php-fpm.d/www.conf.default dest=/usr/local/php/etc/php-fpm.d/www.conf remote_src=yes
    • name: replace
      replace: path=/usr/local/nginx/conf/nginx.conf regexp=’ index index.html index.htm;’ replace=’ index index.php index.html index.htm;’
    • name: shell sed
      shell: sed -i ‘65,71 s/#/ /’ /usr/local/nginx/conf/nginx.conf
    • name: replace
      replace: path=/usr/local/nginx/conf/nginx.conf regexp=’ include fastcgi_params;’ replace=’ include fastcgi.conf;’
    • name: shell
      shell: /etc/init.d/php-fpm restart
    • name: service
      service: name=nginx state=restarted
    • name: unarchive
      unarchive: src=/root/ComsenzDiscuz-DiscuzX-master.zip dest=/root
    • name: delete
      shell: rm -rf /usr/local/nginx/html/*
    • name: shell upload
      shell: cp -r /root/DiscuzX/upload /usr/local/nginx/html
    • name: file
      file: path=/usr/local/nginx/html/upload mode=0777 recurse=yes
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值