《一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码》,点击传送门,即可获取!
[root@192 script]# tree
.
├── lamp+zabbix.sh
└── packages
├── apr-1.7.0.tar.gz
├── apr-util-1.6.1.tar.gz
├── httpd-2.4.51.tar.gz
├── mysql-5.7.34-linux-glibc2.12-x86_64.tar.gz
├── php-8.0.12.tar.gz
└── zabbix-5.4.4.tar.gz
1 directory, 7 files
===================================================================
[root@192 script]# cat lamp+zabbix.sh
#!/bin/bash
route=/usr/local
path=/usr/src
data=/opt/data
pass=123
if [ ! -d $path/apr-1.7.0 ];then
tar xf packages/apr-1.7.0.tar.gz -C $path
fi
if [ ! -d $path/apr-util-1.6.1 ];then
tar xf packages/apr-util-1.6.1.tar.gz -C $path
fi
if [ ! -d $path/httpd-2.4.51 ];then
tar xf packages/httpd-2.4.51.tar.gz -C $path
fi
if [ ! -d $route/php-8.0.12 ];then
tar xf packages/php-8.0.12.tar.gz -C $route
fi
if [ ! -d $route/zabbix-5.4.4 ];then
tar xf packages/zabbix-5.4.4.tar.gz -C $route
fi
if [ ! -d $route/mysql-5.7.34-linux-glibc2.12-x86_64 ];then
tar xf packages/mysql-5.7.34-linux-glibc2.12-x86_64.tar.gz -C $route
cd $route
ln -s mysql-5.7.34-linux-glibc2.12-x86_64 mysql
fi
if [ ! -f /etc/yum.repos.d/CentOS-Base.repo ];then
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
fi
yum -y inst