1: 安装数据库
https://downloads.mysql.com/archives/community/?https://downloads.mysql.com/archives/community/%C2%A0
2:? 源码搭建zabbix 5.0 server
https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.2.tar.gzhttps://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.2.tar.gz或者官网:3 Installation from sourceshttps://www.zabbix.com/documentation/5.0/en/manual/installation/install#Installation-from-sources
2: 开始安装
useradd -s /sbin/nologin -r zabbix
依赖:
yum install unixODBC-devel net-snmp-devel libevent-devel libxml2-devel libcurl-devel -y
编译:
./configure --prefix=/usr/local/zabbix-server --enable-server --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc
--prefix=/usr/local/zabbix-server? ? ? ? # 编译安装路径
--enable-server # 启动server端
--enable-agent ? #启动agent端
--with-mysql=/usr/local/mysql/bin/mysql_config? ? #编译连接mysql相关依赖包,并指定mysql_config的路径
--with-net-snmp #启动snmp相关,用于snmp监控设备
--with-libcurl #启动curl相关
--with-libxml2 #启动xml相关
--with-unixodbc #启动odbc相关用于监控数据库
--enable-java #启动java-agent 用于监控java类用于(这里没有监控java类需求,就没有编译进去)
make && make install
3:? 初始化数据库:
初始化数据库信息
数据库文件在zabbix-5.0.2/database/mysql,分别按顺序导入
schema.sql--images.sql---data.sql
? 登录数据库创建zabbix-server库
启动zabbix:
/usr/local/zabbix-server/sbin/zabbix_server -c /usr/local/zabbix-server/etc/zabbix_server.conf
将mysql lib目录添加到lib环境变量中:
echo '/usr/local/mysql/lib/' > /etc/ld.so.conf.d/mysql.conf
ldconfig -v
再次启动
4:?配置zabbix-server前端界面
?5:? 配置php-fpm 7.2.0以上版本
安装源
wget http://mirrors.aliyun.com/repo/Centos-7.repo
yum?install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
首先,安装阿里的 centos 仓库。(centos 7)
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
yum makecache
yum repolist
安装阿里的 epel 仓库。(centos 7)
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum makecache
yum repolist
安装阿里的 remi 的仓库(centos 7)
安装 php(centos 7)
yum-config-manager --enable remi-php74
yum install -y php74 php74-php-devel php74-php-fpm php74-php-mbstring php74-php-memcache php74-php-memcached php74-php-redis php74-php-mysqlnd php74-php-pdo php74-php-bcmath php74-php-xml php74-php-gd php74-php-gmp php74-php-igbinary php74-php-imagick php74-php-mcrypt php74-php-pdo_mysql php74-php-posix php74-php-simplexml php74-php-opcache php74-php-xsl php74-php-xmlwriter php74-php-xmlreader php74-php-swoole php74-php-zip php74-php-phalcon php74-php-yaml php74-php-yar php74-php-yaf php74-php-uuid
yum install -y https://mirrors.aliyun.com/remi/enterprise/remi-release-7.rpm
sed -i 's/https*:\/\/rpms.remirepo.net/https:\/\/mirrors.aliyun.com\/remi/g' /etc/yum.repos.d/remi*
sed -i 's/#baseurl/baseurl/g' /etc/yum.repos.d/remi*
sed -i 's|^mirrorlist|#mirrorlist|' /etc/yum.repos.d/remi*
yum makecache
yum repolist
yum -y install yum-utils
安装 php(centos 7)
yum-config-manager --enable remi-php74
yum install -y php74 php74-php-devel php74-php-fpm php74-php-mbstring php74-php-memcache php74-php-memcached php74-php-redis php74-php-mysqlnd php74-php-pdo php74-php-bcmath php74-php-xml php74-php-gd php74-php-gmp php74-php-igbinary php74-php-imagick php74-php-mcrypt php74-php-pdo_mysql php74-php-posix php74-php-simplexml php74-php-opcache php74-php-xsl php74-php-xmlwriter php74-php-xmlreader php74-php-swoole php74-php-zip php74-php-phalcon php74-php-yaml php74-php-yar php74-php-yaf php74-php-uuid
?systemctl start php74-php-fpm
mysql
?
|