前言
本实验在centos7和rhel7.6中运行成功
需要实验环境有yum源,nginx-1.18.0.tar,mysql-boost-5.7.30.tar,php-7.4.1.tar包和两个devel包oniguruma-5.9.5-3.el7.x86_64.rpm和oniguruma-devel-5.9.5-3.el7.x86_64.rpm
脚本内容
#!/bin/bash
#-------------------------------------------
# Filename: install_lnmp.sh
# Revision: 1.0
# Lastdate: 2020/7/1
# Author: 海蜘蛛
# Description: lnmp安装配置
#-------------------------------------------
##########################变量声明#############################
#----------------------------------MySQL-------------------------
M_SFILE=mysql-boost-5.7.30.tar.gz
M_FILE=mysql-5.7.30
M_FILE_DIR=/mysql-5.7.30
M_PREFIX=/usr/local/lnmp/mysql
#---------------------------------nginx--------------------------
N_SFILE=nginx-1.18.0.tar.gz
N_FILE=nginx-1.18.0
N_FILE_DIR=/nginx-1.18.0
N_PREFIX=/usr/local/lnmp/nginx
#----------------------------------php----------------------------
P_SFILE=php-7.4.1.tar.gz
P_FILE=php-7.4.1
P_FILE_DIR=/php-7.4.1
P_PREFIX=/usr/local/lnmp/php
#############################菜单#################################
echo -e '---------------------------'
if [ -z "$1" ];then
echo "1)编译安装Nginx"
echo "2)编译安装MySQL"
echo "3)编译安装PHP"
echo "4)一键安装lnmp"
echo "Usage: { /bin/sh $0 1|2|3|4|--help}"
exit
fi
if [[ "$1" -e