centos6.8  系统    zabbix3.4.9   msyql5.7.22   php5.6.24  在centos6上面源码部署zabbix.3.4 问题比较多,需要花不少时间去解决,建议在centos7上面部署zabbix3.4    我这因为公司提供的是centos6.8的系统

1、准备 LNMP环境

nginx部署

nginx部署
[root@centos02 tools]# yum install pcre pcre-devel openssl-devel -y
[root@centos02 tools]# wget http://nginx.org/download/nginx-1.6.3.tar.gz
[root@centos02 tools]# tar xf nginx-1.6..tar.gz
[root@centos02 tools]# cd nginx-1.6.
[root@centos02 nginx-1.6.]# useradd -s /sbin/nologin -M nginx
[root@centos02 nginx-1.6.]# ./configure --prefix=/application/nginx-1.6. --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module
[root@centos02 nginx-1.6.]# make && make install
[root@centos02 nginx-1.6.]# ln -s /application/nginx-1.6./ /application/nginx
[root@centos02 nginx-1.6.]# /application/nginx/sbin/nginx -t 检查语法
[root@centos02 nginx-1.6.]# /application/nginx/sbin/nginx 启动nginx

mysql  去官方下载5.7.22版本

https://dev.mysql.com/downloads/mysql/5.7.html#downloads

yum install -y gcc gcc-c++ cmake bison ncurses-devel

tar xf mysql-boost-5.7..tar.gz
tar xf mysql-5.7..tar.gz
cd mysql-5.7.

cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DSYSCONFDIR=/etc/my.cnf \
-DMYSQL_DATADIR=/data/mysql/ \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DMYSQL_TCP_PORT=3306 \
-DEFAULT_CHARSET=utf8 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEFAULT_COLLATION=utf8_general_ci \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DWITH_BOOST=./boost \
#-DWITH_SYSTEMD=1  #该参数在centos7上面才需要

make -j
make install cat /etc/my.cnf
[mysqld]
datadir=/data/mysql
socket=/tmp/mysql.sock
basedir=/usr/local/mysql # basic setting
user=mysql
port=
server-id= #log
slow_query_log_file = /binlog/mysqlog/slow.log
slow_query_log = # Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links= log-error=/binlog/mysqlog/err.log [mysql]
socket=/tmp/mysql.sock 初始化数据
useradd -M -s /sbin/nologin mysql
cd /usr/local/mysql/bin
./mysqld --initialize --user=mysql --datadir=/data/mysql --basedir=/usr/local/mysql --socket=/tmp/mysql.sock --log-error=/binlog/mysqlog/err.log --log-bin=/binlog/mysqlog/mysql-bin

cp /server/tools/mysql-5.7.22/support-files/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

ln -s /usr/local/mysql/bin/mysql /usr/bin

可能会遇到的问题

grep 'temporary password' /binlog/mysqlog/err.log

2018-05-29T04:52:17.888490Z 1 [Note] A temporary password is generated for root@localhost: 3DQp3jeZlC!h

mysql -uroot -p

mysql> update mysql.user set authentication_string = password("0a4c6d5@f9c5b016") where user="root" ;   #设置root密码

Mysql5.7 密码过期解决

ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.

mysql> select * from mysql.user where user='root' \G

x509_issuer:
x509_subject:
max_questions: 0
max_updates: 0
max_connections: 0
max_user_connections: 0
plugin: mysql_native_password
authentication_string: *CF9A80CD3544352D311C63FBF98FF969B4B7AB10
password_expired: Y
password_last_changed: 2018-05-29 12:52:18
password_lifetime: NULL
account_locked: N
1 row in set (0.00 sec)

mysql> update user set password_expired='N' where user='root'; #密码过期解决方法

php

[root@centos02 libiconv-1.14]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
[root@centos02 tools]# yum install zlib-devel libxml2-devel libjpeg-devel libiconv-devel -y
[root@centos02 tools]# yum install freetype-devel libpng-devel gd-devel curl-devel libxslt-devel -y
[root@centos02 libiconv-1.14]# yum -y install libmcrypt-devel mhash mhash-devel mcrypt libxslt-devel 
[root@centos02 tools]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz 
[root@centos02 tools]# tar xf libiconv-1.14.tar.gz 
[root@centos02 tools]# cd libiconv-1.14
[root@centos02 libiconv-1.14]# ./configure --prefix=/usr/local/libiconv
[root@centos02 libiconv-1.14]# make && make install
[root@centos02 tools]# wget  http://cn2.php.net/distributions/php-5.6.24.tar.gz
[root@centos02 tools]# tar xf php-5.6..tar.gz
[root@centos02 tools]# cd php-5.6.
[root@centos02 php-5.6.]# ./configure \

--prefix=/application/php5.6.24 \
--with-mysql=/usr/local/mysql/ \
--with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--enable-short-tags \
--enable-zend-multibyte \
--enable-static \
--with-xsl \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-ftp \
--with-gettext

可能遇到的如下报错

/server/tools/php-5.6.24/ext/iconv/iconv.c:1195: undefined reference to `libiconv_open'
/server/tools/php-5.6.24/ext/iconv/iconv.c:1209: undefined reference to `libiconv_open'
/server/tools/php-5.6.24/ext/iconv/iconv.c:1328: undefined reference to `libiconv'
/server/tools/php-5.6.24/ext/iconv/iconv.c:1280: undefined reference to `libiconv'
/server/tools/php-5.6.24/ext/iconv/iconv.c:1312: undefined reference to `libiconv'
/server/tools/php-5.6.24/ext/iconv/iconv.c:1470: undefined reference to `libiconv_close'
/server/tools/php-5.6.24/ext/iconv/iconv.c:1380: undefined reference to `libiconv'
/server/tools/php-5.6.24/ext/iconv/iconv.c:1411: undefined reference to `libiconv'
/server/tools/php-5.6.24/ext/iconv/iconv.c:1467: undefined reference to `libiconv_close'
/server/tools/php-5.6.24/ext/iconv/iconv.c:1454: undefined reference to `libiconv'

解决办法

在执行完 ./configure ... 之后,修改下 Makefile,找到其中的

PHP
  1. EXTRA_LIBS = -lcrypt -lz -lcrypt -lrt -lmysqlclient -lmcrypt -lldap -llber -lfreetype -lpng -lz -ljpeg -lcurl -lz -lrt -lm -ldl -lnsl -lrt -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lz -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxml2-lz -lm -lcrypt

在后面添加 -liconv,即修改为:

PHP
  1. EXTRA_LIBS = -lcrypt -lz -lcrypt -lrt -lmysqlclient -lmcrypt -lldap -llber -lfreetype -lpng -lz -ljpeg -lcurl -lz -lrt -lm -ldl -lnsl -lrt -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lz -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxml2-lz -lm -lcrypt -liconv
[root@centos02 application]# ln -s /usr/local/mysql/lib/libmysqlclient.so.18  /usr/lib64/
[root@centos02 application]# touch ext/phar/phar.phar
[root@centos02 application]# make && make install

curl 7.19.7  系统默认版本,升级该软件版本,否则后面邮件功能会有问题  参考官方说明https://www.zabbix.com/documentation/3.4/zh/manual/installation/install

cat /etc/yum.repos.d/curl.repo
[CityFan]
name=City Fan Repo
baseurl=http://nervion.us.es/city-fan/yum-repo/rhel$releasever/$basearch/
enabled=
gpgcheck=0

yum install libcurl


curl -V
curl 7.60.0 (x86_64-redhat-linux-gnu) libcurl/7.60.0 OpenSSL/1.0.1e zlib/1.2.3 c-ares/1.14.0 libssh2/1.8.0 nghttp2/1.6.0
Release-Date: 2018-05-16
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy Metalink

yum -y install net-snmp-devel  libevent-devel   java-devel -y

编译安装zabbix3.4   去官方下载源码包

 ./configure --prefix=/application/zabbix-server --enable-server --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --enable-agent --enable-proxy --enable-java
make install

mysql> create database zabbix character set utf8 collate utf8_bin;

Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'xxx';

Query OK, 0 rows affected, 1 warning (0.00 sec)

由于zabbix启动脚本路径默认指向的是/usr/local/sbin路径,因此,需要提前建立软链接

[root@Yeahka-6 zabbix-3.4.9]# ln -s /application/zabbix-server/sbin/* /usr/local/sbin/

[root@Yeahka-6 zabbix-3.4.9]# ln -s /application/zabbix-server/bin/* /usr/local/bin/

[root@Yeahka-6 zabbix-3.4.9]# mkdir /application/nginx/html/zabbix

[root@Yeahka-6 zabbix-3.4.9]#  cp -ar /server/tools/zabbix-3.4.9/frontends/php/* /application/nginx/html/zabbix/

[root@Yeahka-6 zabbix-3.4.9]# cd /server/tools/zabbix-3.4.9/database/mysql/

[root@Yeahka-6 mysql]# ll

总用量 4872

-rw-r--r-- 1 1001 1001 2873211 5月   9 17:58 data.sql

-rw-r--r-- 1 1001 1001 1978341 5月   9 17:57 images.sql

-rw-r--r-- 1 1001 1001  134791 5月   9 17:58 schema.sql

mysql -uzabbix -pxxx zabbix < schema.sql

mysql -uzabbix -pxxx zabbix < images.sql

mysql -uzabbix -pxxx zabbix < data.sql

cp /server/tools/zabbix-3.4.9/misc/init.d/fedora/core/zabbix_server /etc/init.d/

cp /server/tools/zabbix-3.4.9/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/

默认的用户名是Admin,密码是zabbix

附上配置

cat /application/nginx/conf/nginx.conf
worker_processes ;
events {
worker_connections ;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout ;
server {
listen ;
server_name 192.168.11.147;
location / {
root html;
index index.php index.html index.htm;
} location ~ .*\.(php|php5)?$ {
root html;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
include fastcgi.conf;
}
access_log logs/access_zabbix.log main;
} server {
listen ;
server_name bbs.martin.com;
location / {
root html/bbs;
index index.php index.html index.htm;
} location ~ .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
include fastcgi.conf;
}
access_log logs/access_bbs.log main;
}
###status
server{
listen ;
server_name 192.168.11.147;
location / {
stub_status on;
access_log off;
}
}
}

cat /application/php/etc/php-fpm.conf
[global]
[www]
user = nginx
group = nginx
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

 

解决zabbix中文乱码

[root fonts]# pwd
/application/nginx/html/zabbix/fonts
[root@s fonts]# ll
总用量 36264
-rw-r--r-- 1 1001 1001 756072 5月 9 17:57 DejaVuSans.ttf
-rw-r--r-- 1 root root 14602860 6月 11 2009 msyhbd.ttf
-rw-r--r-- 1 root root 21767952 6月 11 2009 msyh.ttf
[root fonts]# mv DejaVuSans.ttf /opt/

[root include]# pwd
/application/nginx/html/zabbix/include
[root include]# vim defines.inc.php

s/DejaVuSans/msyhbd/g 替换为新的字体

zabbix3.4 源码部署的更多相关文章

  1. java源码部署

    环境:nginx+tomcat部署方式:源码部署源码目录 /chroot2/test/schedule 目录下面就是所有源码了tomcat 位置: /usr/local/tomcat/apache-t ...

  2. Openfire4源码部署到eclipse中并编译

    Openfire4源码部署到eclipse中并编译 概述 Openfire是众所周知的基于xmpp协议的IM开源服务,所有操作,配置,监控,调试等以B/S方式进行展示,非常的方便管理员进行管理.它的强 ...

  3. mondrian 4.7 源码部署

    mondrian是一个开源的数据分析工程, 网上有关mondrian3.X的源码部署比较多, 有关4.X的部署较少. 目前官方推荐使用的时mondrian3.7的修订版, 可以再github上下载到最 ...

  4. 01_kettle源码部署

    一 kettle源码部署概述 1.从git上选择合适的版本,并down下来: 2.创建一个java项目,建立core,dbdialog,engine,ui,plugins文件夹,和一个lib文件夹: ...

  5. 单点登录(六)-----遇到问题-----cas server 源码部署导入gradle后有感叹号---错误信息A cycle was detected in the build path of pr

    cas server 源码部署导入gradle后有感叹号---错误信息A cycle was detected in the build path of project 'cas-server-cor ...

  6. 单点登录(五)-----遇到问题-----cas server 源码部署tomcat运行报错BeanCreationException:Error creating bean with name 's

    我们在上一篇文章已经解决了把下载好的cas server源码部署到tomcat缺少子项目编辑文件或者jar包导致找不到class报错的问题 单点登录(四)-----遇到问题-----cas serve ...

  7. 单点登录(四)-----遇到问题-----cas server 源码部署tomcat运行报错ClassNotFoundException: org.jasig.cas.CasEnvironmentCo

    情况 cas单点登录 cas server 源码部署tomcat运行报错 把cas server的代码下载下来后使用gradle插件或者maven插件以及转化成eclipse·后导入发现部署到tomc ...

  8. centos7.6环境zabbix3.2源码编译安装版升级到zabbix4.0长期支持版

    zabbix3.2源码编译安装版升级到zabbix4.0长期支持版 项目需求: .2版本不再支持,想升级成4.0的长期支持版 环境介绍: zabbix服务端是编译安装的,数据库和web在一台机器上 整 ...

  9. zabbix3.4源码安装步骤

    zabbix3.4源码安装步骤1.安装环境: 安装机器:22.224.9.227 以下简称监控机: 操作系统信息:内核版本: Linux version 2.6.18-194.1.AXS3 (pack ...

随机推荐

  1. python读取txt写入txt

    http://www.cnblogs.com/allenblogs/archive/2010/09/13/1824842.html

  2. vbs自由选择启动bat文件

    1.首先创建一个文件夹用来放bat文件和配置文件. 2.然后在bat文件中写入启动程序.中间红色框是启动程序,外面程序是用来隐藏命令提示符的. 3.txt配置文件配置vbs启动项,vbs只能找到此文件 ...

  3. 关于多行文本 textarea 在ios 真机上padding相对安卓较大问题

    问题: 多行文本组件是带有默认的padding的,然而,小程序的teatarea 在ios和安卓上显示的padding不一样,普遍ios的padding会比安卓的要明显的大.这种情况下我的想法是做兼容 ...

  4. linux内核--定时器API

    /**<linux/timer.h> 定时器结构体 struct timer_list { ........ unsigned long expires; --内核希望定时器执行的jiff ...

  5. 【CodeBase】PHP检查未知媒体文件的格式

    用法: <?php $filefullpath="F:/test/2awd45wr1e5fef5e5"; echo Format::check($filefullpath,[ ...

  6. PHP 批量操作 Excel

    自己封装了一个批量操作excel文件的方法,通过xls文件地址集合遍历,第三个参数传入一个匿名函数用于每个需求的不同进行的操作,实例中我想要得到列表中含有折字的行,封装成sql语句返回. xls文件超 ...

  7. Zookeeper协调服务系统·ELK日志管理系统简介

    Zookeeper协调服务系统: 说明:它分布式系统中的协调服务系统,是Hadoop下的一个子项目,可提供的服务有:名字服务.配置服务.分布式同步.组服务等. 3个角色:Leaders.Follow. ...

  8. 动态规划:HDU1864-最大报销额(处理带小数的dp问题)

    最大报销额 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Descriptio ...

  9. BFS:HDU2612-Find a way(双向BFS)

    Find a way Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  10. 线程、进程、队列、IO多路模型

    操作系统工作原理介绍.线程.进程演化史.特点.区别.互斥锁.信号.事件.join.GIL.进程间通信.管道.队列.生产者消息者模型.异步模型.IO多路复用模型.select\poll\epoll 高性 ...