zabbix-3.4.6安装


先安装myql和php
mysql5.7.17: http://www.cnblogs.com/cjsblogs/p/8116782.html

php7.2.1: http://www.cnblogs.com/cjsblogs/p/8116782.html

安装zabbix
# tar -zxf zabbix-3.4.6.tar.gz
# cd zabbix-3.4.6

# mkdir -p /usr/local/zabbix/logs
# ./configure --prefix=/usr/local/zabbix --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --enable-server --enable-agent --enable-proxy --with-libcurl --with-ssh2 --with-openipmi --with-unixodbc --enable-java

make && make install

  

创建zabbix用户和用户组

# groupadd zabbix
# useradd -r -g zabbix zabbix
# cd /usr/local && chown -R zabbix:zabbix zabbix

  


创建zabbix数据库,并导入表结构
# mysql -uroot -p
mysql> create database if not exists zabbix default character set utf8 collate utf8_general_ci;
mysql> use zabbix;
mysql> source /tmp/zabbix-3.4.6/database/mysql/schema.sql;
mysql> source /tmp/zabbix-3.4.6/database/mysql/images.sql;
mysql> source /tmp/zabbix-3.4.6/database/mysql/data.sql;

 

修改zabbix_server.conf

LogFile=/usr/local/zabbix/logszabbix_server.log
LogFileSize=50
PidFile=/usr/local/zabbix/etc/zabbix_server.pid
SocketDir=/var/run/zabbix
DBName=zabbix
DBPassword=zabbix
DBUser=zabbix
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000

  

启动zabbix_server 

# ln -s /usr/local/mysql/lib/libmysqlclient.so.20 /usr/lib/
# ldconfig
# /usr/local/zabbix/sbin/zabbix_server

 

 

安装NGINX

nginx: http://www.cnblogs.com/cjsblogs/p/8426140.html

 

添加配置文件zabbix.conf

# cd /usr/local/nginx/conf/vhosts/
# vim zabbix.conf
server {
    listen 80;
    server_name ip;
    root /usr/local/nginx/html/zabbix;
    index index.html index.htm index.php;

    location ~* ^.+\.(js|ico|gif|jpg|jpeg|pdf|png|css|swf)$ {
         expires      30d;
         access_log   off;
     }

    location ~ ^/.*\.php?$ {
         include fcgi.conf;
         fastcgi_pass 127.0.0.1:9000;
         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
         include        fastcgi_params;
     }
}

 

拷贝网页文件到 nginx 目录

cp -r ~/zabbix-3.4.6/frontends/php/ /usr/local/nginx/html/zabbix
chown -R www.www /usr/local/nginx/html/zabbix

 

启动nginx

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

 

  

 

转载于:https://www.cnblogs.com/cjsblogs/p/8425444.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值