lnmp一鍵安裝包下載安裝方式
參考:https://blog.linuxeye.cn/31.html
我這裏就不一一詳述了 上面的作者介紹的比我仔細
ansible實現lnmp無交互安裝lnmp和依賴環境
root@centos-mysql01:/data/sh# vim lnmp_install.yml
- hosts: docker
remote_user: root
tasks:
- name: file exeit
shell: ls /data/ansibel/lnmp
register: result
ignore_errors: True
- name: lnmp
shell: ls /data/sh/lnmp-full.tar.gz
register: result
ignore_errors: True
- name: wget lnmp tar gz
command: wget http://mirrors.linuxeye.com/lnmp-full.tar.gz chdir=/data/sh
when: lnmp|failed
- name: lnmp_install
shell: ls /data/sh/lnmp1_install.sh
register: lnmp_shell
ignore_errors: True
- name: tar xf lnmp
unarchive: src=/data/ansibel/lnmp-full.tar.gz dest=/data/sh copy=yes mode=0755
when: result|failed
- name: copy install shell
copy: src=/data/sh/lnmp1_install.sh mode=0644 dest=/data/sh/lnmp1_install.sh
when: lnmp_shell|failed
- name: shell lnmp install
shell: sh /data/sh/lnmp1_install.sh
/data/sh/lnmp1_install.sh腳本
cd /data/sh/lnmp &&./install.sh << EOF
22 #ssh端口
n #是否開啓防火牆
y #是否安裝web服務
1 #安裝nginx
3 #不安裝apache
y #是否安裝數據庫
1 #MYSQL版本
hanye131 #mysql密碼
1 #是否安裝php
y #php版本
7 #我這裏是php7.2
y #是否安裝opcache
y #ionCube
y #ImageMagick or GraphicsMagick
1 #nstall ImageMagick
n #install Pure-FTPd
n #install phpMyAdmin
y #install redis
n #install memcached
n install HHVM
EOF
上面選擇選擇適合自己的環境安裝對應的數字修改即可