没有合适的资源?快使用搜索试试~ 我知道了~
支持CentOS 6.5系统的zabbix一键部署脚本Nginx 1.6.2 + mysql5.5.x + PHP-FPM 5.4.x + Zabbix 2.4.4
资源推荐
资源详情
资源评论
#!/bin/bash
# install Nginx 1.6.2 + mysql5.5.x + PHP-FPM 5.4.x + Zabbix 2.4.4 automatically.
# Tested on CentOS 6.5
##############################################
# 变量
##############################################
err_echo(){
echo -e "\e[91m[Error]: $1 33[0m"
exit 1
}
info_echo(){
echo -e "\e[92m[Info]: $1 33[0m"
}
warn_echo(){
echo -e "\e[93m[Warning]: $1 33[0m"
}
check_exit(){
if [ $? -ne 0 ]; then
err_echo "$1"
exit1
fi
}
##############################################
# check
##############################################
if [ $EUID -ne 0 ]; then
# install Nginx 1.6.2 + mysql5.5.x + PHP-FPM 5.4.x + Zabbix 2.4.4 automatically.
# Tested on CentOS 6.5
##############################################
# 变量
##############################################
err_echo(){
echo -e "\e[91m[Error]: $1 33[0m"
exit 1
}
info_echo(){
echo -e "\e[92m[Info]: $1 33[0m"
}
warn_echo(){
echo -e "\e[93m[Warning]: $1 33[0m"
}
check_exit(){
if [ $? -ne 0 ]; then
err_echo "$1"
exit1
fi
}
##############################################
# check
##############################################
if [ $EUID -ne 0 ]; then
err_echo "please run this script as root user."
exit 1
fi
if [ "$(awk '{if ( $3 >= 6.0 ) print "CentOS 6.x"}' /etc/redhat-release 2>/dev/null)" != "CentOS 6.x" ];then
err_echo "This script is used for RHEL/CentOS 6.x only."
fi
##############################################
# Useradd deploy nginx程序运行账号
##############################################
info_echo "Useradd deploy"
useradd deploy
##############################################
# yum repo
##############################################
info_echo "配置yum源......"
if [ ! -f LNMP+zabbix.repo ]; then
cat> /etc/yum.repos.d/LNMP+zabbix.repo <<'EOF'
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1
[webtatic]
name=Webtatic Repository EL6 - $basearch
#baseurl=http://repo.webtatic.com/yum/el6/$basearch/
mirrorlist=http://mirror.webtatic.com/yum/el6/$basearch/mirrorlist
failovermethod=priority
exit 1
fi
if [ "$(awk '{if ( $3 >= 6.0 ) print "CentOS 6.x"}' /etc/redhat-release 2>/dev/null)" != "CentOS 6.x" ];then
err_echo "This script is used for RHEL/CentOS 6.x only."
fi
##############################################
# Useradd deploy nginx程序运行账号
##############################################
info_echo "Useradd deploy"
useradd deploy
##############################################
# yum repo
##############################################
info_echo "配置yum源......"
if [ ! -f LNMP+zabbix.repo ]; then
cat> /etc/yum.repos.d/LNMP+zabbix.repo <<'EOF'
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1
[webtatic]
name=Webtatic Repository EL6 - $basearch
#baseurl=http://repo.webtatic.com/yum/el6/$basearch/
mirrorlist=http://mirror.webtatic.com/yum/el6/$basearch/mirrorlist
failovermethod=priority
剩余10页未读,继续阅读
资源评论
偶是江湖中人
- 粉丝: 113
- 资源: 294
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功