zoukankan      html  css  js  c++  java
  • Centos6.8源码编译安装zabbix3.4.1

    一、安装系统环境

    Zabbix服务器运行环境为Linux+PHP+Nginx+MySQL,以下为安装详细版本环境:

    Centos 6.8  + PHP 7.1.8 + Nginx 1.10.0 + MySQL5.7.17 + Zabbix 3.4.1

    其次,关闭防火墙和SELINUX

    service iptbales stop
    setenforce 0

    二、安装配置Zabbix

    1)先安装Zabbix需要的插件

    yum install libdbi-dbd-mysql net-snmp-devel curl-devel net-snmp libcurl-devel libxml2-devel

    2)安装Zabbix就需要导入Zabbix官方的源了,官方版本比较新,其余的系统自带源或EPEL源的Zabbix都很旧,选项源时找好对应的系统版本号以及架构平台。

    rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/6/x86_64/zabbix-release-3.4-1.el6.noarch.rpm

    3)有了源之后使用YUM安装即可(yum install zabbix-server),但这里我使用源码安装Zabbix 3.0。先把编译库安装一下。

    yum groupinstall "Development tools" "Compatibility libraries"

    4)然后在https://fossies.org/linux/misc/zabbix-3.4.1.tar.gz/ 下载zabbix-3.4.1.tar.gz源码包

    5)接下来添加用户后就进行编译安装

    groupadd zabbix
    useradd -g zabbix zabbix
    tar xf zabbix-3.0.4.tar.gz
    cd zabbix-3.0.4
    ./configure --prefix=/usr/local/zabbix-server --enable-server --with-mysql --with-net-snmp --with-libcurl --with-libxml2
    make && make install

    6)安装完后就进行数据库文件导入操作

    cd /root/zabbix-3.0.4/database/mysql
    
    mysql -uzabbix -p zabbix < schema.sql
    mysql -uzabbix -p zabbix < images.sql
    mysql -uzabbix -p zabbix < data.sql

    7)编辑配置文件

    vim /usr/local/zabbix-server/etc/zabbix_server.conf
    ListenPort=10051
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=zabbix
    ListenIP=0.0.0.0

    8)启动Zabbix

    /usr/local/zabbix-server/sbin/zabbix_server -c /usr/local/zabbix-server/etc/zabbix_server.conf

    9)查看监听端口

    netstat -nplt | grep zabbix_server
    tcp     0      0 0.0.0.0:10051          0.0.0.0:*              LISTEN      13677/zabbix_server

    10)拷贝zabbix应用到Nginx根目录

    rm -fr /usr/share/nginx/html/*
    cd /root/zabbix-3.0.4/frontends/php/
    cp -a . /usr/share/nginx/html/
    chown -R nginx.nginx /usr/share/nginx/html/*

    11)配置PHP

    cat /etc/php.ini
    date.timezone = Asia/Shanghai
    post_max_size = 16M
    max_execution_time = 300
    max_input_time = 300

    12)配置Nginx

    cat /etc/nginx/conf.d/default.conf
    server {
        listen 80;
        server_name localhost;
        #charset koi8-r;
        access_log /var/log/nginx/access.log main;
        error_log /var/log/nginx/error.log error;
     
        location / {
            root /usr/share/nginx/html;
            index index.html index.htm index.php;
        }
     
        # redirect server error pages to the static page /50x.html
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
            root /usr/share/nginx/html;
        }
     
        location ~ .php$ {
            root           /usr/share/nginx/html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
    service nginx restart

    好了,当这些都安装配置完了并且都成功启动了后就可以用浏览器访问本机IP,并按照提示安装Zabbix即可。

    打开浏览器后会看到如下界面,首先会检查Zabbix需要的环境,如果都是OK状态,那么就没有什么问题了,可以继续下一步。如果检查没有通过就要看看缺少什么,然后安装即可。

    GOOD LUCK!

    参考博客 http://www.ywnds.com/?p=5891

    参考文档 https://www.zabbix.com/documentation/3.4/

    更多详情,请访问个人博客:https://www.wchonge.com

  • 相关阅读:
    4.变量以及类型
    3.注释
    2.第一个python程序
    1.认识Python
    DB安装
    DB2<RedHed Linux> 创建数据库
    win 7设置主机域名
    FTP 错误1
    FTP 其他设置
    VM浏览器不能访问
  • 原文地址:https://www.cnblogs.com/wchonge/p/8446886.html
Copyright © 2011-2022 走看看