码迷,mamicode.com
首页 > 其他好文 > 详细

源码安装zabbix

时间:2020-05-20 00:22:44      阅读:87      评论:0      收藏:0      [点我收藏+]

标签:har   text   iconv   ble   ram   logfile   bin   bz2   utf8   

一.zabbix-server:

yum install libxml2-devel net-snmp-devel libevent-devel curl-devel pcre* mariadb-devel php-fpm
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent 
    --enable-proxy --with-mysql=/usr/local/mysql/bin/mysql_config --enable-ipv6 
    --with-net-snmp --with-libcurl --with-libxml2
导入数据库:
groupadd zabbix
useradd -g zabbix zabbix
mysql> create database zabbix character set utf8;
mysql> grant all on zabbix.* to zabbix@localhost identified by zabbix@qaz;
mysql> flush privileges;

# vim /usr/local/zabbix/etc/zabbix_server.conf
LogFile=/usr/local/zabbix/log/zabbix_server.log        //日志文件存放的路径
PidFile=/usr/local/zabbix/zabbix_server.pid        //pid文件存放的路径
DBHost=localhost        //数据库服务器地址
DBName=zabbix        //数据库名字
DBUser=zabbix        //连接数据库的用户名
DBPassword=zabbix@qaz        //连接数据库用户的密码
DBSocket=/var/lib/mysql/mysql.sock        //指定连接mysql的socket,mysql配置的client sock文件路径
DBPort=3306        //数据库端口
Timeout=4        //超时时间
LogSlowQueries=3000        //慢查询记录的时间
# mkdir /usr/local/zabbix/log
# chown zabbix.zabbix /usr/local/zabbix/log

启动:
chown zabbix.zabbix /usr/local/zabbix/
/usr/local/zabbix/sbin/zabbix_server -c /usr/local/zabbix/etc/zabbix_server.conf

web界面:
cp -r  /root/zabbix-5.0.0/ui/ /var/www/
chown -R www.www /var/www

二.安装php-fpm7.2

// 源码安装
  yum install openssl openssl-devel curl curl-devel libjpeg libjpeg-devel libpng    libpng-devel freetype freetype-devel pcre pcre-devel libxslt libxslt-devel bzip2 bzip2-devel
  ./configure --prefix=/usr/local/php --with-curl --with-freetype-dir --with-gd   --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64    --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql   --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc   --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath   --enable-libxml --enable-inline-optimization --enable-mbregex   --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap   --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip
  make && make install
  

// yum 安装
2. yum install epel-release -y
   rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
   yum -y remove php*
   yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel                    php72w-mysql php72w-bcmath php72w-mbstring php72w-gd php72w-xml php72w-ldap
                   
    /etc/php-fpm.d/www.conf
    listen = /var/run/phpfpm.sock
    listen.owner = www
    listen.group = www
    
    systemctl restart php-fpm

三.nginx配置

user  www;
server {
        listen       80;
        server_name  zabbix.c.com;

        autoindex off;
        #charset koi8-r;

        #access_log  logs/host.access.log  main;
        index index.php;
        root /var/www/ui;

        location ~ \.php$ {
            fastcgi_pass unix:/var/run/phpfpm.sock;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include fastcgi_params;
         }

登录:
    http://域名 初始账号:Admin 密码:zabbix

 

源码安装zabbix

标签:har   text   iconv   ble   ram   logfile   bin   bz2   utf8   

原文地址:https://www.cnblogs.com/ccqk/p/12920593.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!