zabbix--源码安装部署zabbix3.2
zabbix运行在lamp环境或者lnmp环境都是可以的,如果是新系统推荐使用lamp或者lnmp一键安装包,
或者可以向下面这种方式:
PHP安装
源码安装
rpm -ivh php55w-common-5.5.-.w6.x86_64.rpm; rpm -ivh php55w-cli-5.5.-.w6.x86_64.rpm; rpm -ivh php55w-5.5.-.w6.x86_64.rpm; rpm -ivh t1lib-5.1.-.el6_2..x86_64.rpm; rpm -ivh php55w-gd-5.5.-.w6.x86_64.rpm; rpm -ivh php55w-pdo-5.5.-.w6.x86_64.rpm; rpm -ivh php55w-mysql-5.5.-.w6.x86_64.rpm; rpm -ivh php55w-bcmath-5.5.-.w6.x86_64.rpm; rpm -ivh php55w-mbstring-5.5.-.w6.x86_64.rpm; rpm -ivh php55w-xml-5.5.-.w6.x86_64.rpm; rpm -ivh php55w-ldap-5.5.-.w6.x86_64.rpm;
PS:遇到的问题,安装第三个php rpm包时,提示:
没有安装httpd-mmn = 20051115
[root@monitor-server zabbix_file]# rpm -ivh php55w-5.5.-.w6.x86_64.rpm
warning: php55w-5.5.-.w6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cf4c4ff9: NOKEY
error: Failed dependencies:
httpd-mmn = is needed by php55w-5.5.-.w6.x86_64
httpd is needed by php55w-5.5.-.w6.x86_64
[root@monitor-server zabbix_file]#
这里需要安装httpd服务,但安装httpd时,提示:
[root@monitor-server zabbix_file]# rpm -ivh httpd-2.2.-.el6.centos..x86_64.rpm
error: Failed dependencies:
apr-util-ldap is needed by httpd-2.2.-.el6.centos..x86_64
httpd-tools = 2.2.-.el6.centos. is needed by httpd-2.2.-.el6.centos..x86_64
libapr-.so.()(64bit) is needed by httpd-2.2.-.el6.centos..x86_64
libaprutil-.so.()(64bit) is needed by httpd-2.2.-.el6.centos..x86_64
因为机器不能访问外网,我只上传了个iso镜像上去做本地yum源,也许改用源码的方式安装httpd会靠谱些,但编译时提示:
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... yes
setting CC to "gcc"
setting CPP to "gcc -E"
setting CFLAGS to " -g -O2 -pthread"
setting CPPFLAGS to " -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE"
setting LDFLAGS to " "
configure:
configure: Configuring Apache Portable Runtime Utility library...
configure:
checking for APR-util... no
configure: error: APR-util not found. Please read the documentation.
还是绕不过上面的那个坎,apr-util
我参考了这篇博客:http://www.linuxidc.com/Linux/2012-06/62289.htm
今日编译apache时出错: #./configure --prefix……检查编辑环境时出现: checking for APR... no
configure: error: APR not found . Please read the documentation 解决办法: .下载所需软件包: wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
.编译安装: yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs
具体步骤如下: a:解决apr not found问题>>>>>> [root@xt test]# tar -zxf apr-1.4..tar.gz
[root@xt test]# cd apr-1.4.
[root@xt apr-1.4.]# ./configure --prefix=/usr/local/apr
[root@xt apr-1.4.]# make && make install b:解决APR-util not found问题>>>> [root@xt test]# tar -zxf apr-util-1.3..tar.gz
[root@xt test]# cd apr-util-1.3.
[root@xt apr-util-1.3.]# ./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr--config
[root@xt apr-util-1.3.]# make && make install c:解决pcre问题>>>>>>>>> [root@xt test]#unzip -o pcre-8.10.zip
[root@xt test]#cd pcre-8.10
[root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre
[root@xt pcre-8.10]#make && make install
.最后编译Apache时加上: --with-apr=/usr/local/apr \ --with-apr-util=/usr/local/apr-util/ \ --with-pcre=/usr/local/pcre 成功编译完成~
不过安装apr和apr-util之前又遇到个坑:
编译apr时出现这个报错:configure: error: no acceptable C compiler found in $PATH
原因是系统没安装gcc软件套件,还好这个本地yum有(终于起作用了,好感动),直接yum install gcc就行。
安装pcre时又遇到坑:这次提示g++ 在make pcre的时候出现libtool: line 990: g++: command not found错误 解决方法:yum -y install gcc+ gcc-c++,都装了。
继续make pcre又报错:.libs/pcrecpp.o: could not read symbols: Bad value 解决方法:./configure --disable-shared --with-pic 编译时多加个参数
好了,继续源码安装apache
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre make && make install
嗯,安装完php,继续!
PS:发现一件尴尬的事情,apr相关的包,在本地yum源里有。。
配置PHP参数:
[root@mid01 zabbix_file]# sed -i "s@;date.timezone =@date.timezone = Asia/Shanghai@g" /etc/php.ini
[root@mid01 zabbix_file]# sed -i "s@max_execution_time = 30@max_execution_time = 300@g" /etc/php.ini
[root@mid01 zabbix_file]# sed -i "s@post_max_size = 8M@post_max_size = 32M@g" /etc/php.ini
[root@mid01 zabbix_file]# sed -i "s@max_input_time = 60@max_input_time = 300@g" /etc/php.ini
[root@mid01 zabbix_file]# sed -i "s@memory_limit = 128M@memory_limit = 128M@g" /etc/php.ini
[root@mid01 zabbix_file]# sed -i "s@;mbstring.func_overload = 0@ambstring.func_overload = 2@g" /etc/php.ini
[root@mid01 zabbix_file]# sed -i "s@;always_populate_raw_post_data =@always_populate_raw_post_data = -1@g" /etc/php.ini
接着安装mysql,要查看是否已安装mysql,如果版本不符合,则需要卸载,重装:
[root@mid01 zabbix_file]# rpm -qa| grep mysql
mysql-5.1.-.el6.x86_64
mysql-server-5.1.-.el6.x86_64
php55w-mysql-5.5.-.w6.x86_64
qt-mysql-4.6.-.el6_4.x86_64
mysql-libs-5.1.-.el6.x86_64
强制卸载:
[root@mid01 zabbix_file]# rpm -e --nodeps mysql-5.1.-.el6.x86_64
[root@mid01 zabbix_file]# rpm -e --nodeps mysql-server-5.1.-.el6.x86_64
warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave
[root@mid01 zabbix_file]# rpm -e --nodeps mysql-libs-5.1.-.el6.x86_64
下载mysql5.5tar包并解压:
[root@mid01 zabbix_file]# tar -xvf MySQL-5.5.-.el6.x86_64.rpm-bundle.tar
MySQL-shared-5.5.-.el6.x86_64.rpm
tar: MySQL-shared-5.5.-.el6.x86_64.rpm: time stamp -- :: is 15825714.217439403 s in the future
MySQL-test-5.5.-.el6.x86_64.rpm
tar: MySQL-test-5.5.-.el6.x86_64.rpm: time stamp -- :: is 15825717.725779682 s in the future
MySQL-server-5.5.-.el6.x86_64.rpm
tar: MySQL-server-5.5.-.el6.x86_64.rpm: time stamp -- :: is 15825702.522847995 s in the future
MySQL-embedded-5.5.-.el6.x86_64.rpm
tar: MySQL-embedded-5.5.-.el6.x86_64.rpm: time stamp -- :: is 15825680.34405559 s in the future
MySQL-client-5.5.-.el6.x86_64.rpm
tar: MySQL-client-5.5.-.el6.x86_64.rpm: time stamp -- :: is 15825671.899264437 s in the future
MySQL-devel-5.5.-.el6.x86_64.rpm
tar: MySQL-devel-5.5.-.el6.x86_64.rpm: time stamp -- :: is 15825676.822329417 s in the future
MySQL-shared-compat-5.5.-.el6.x86_64.rpm
tar: MySQL-shared-compat-5.5.-.el6.x86_64.rpm: time stamp -- :: is 15825711.705837133 s in the future
[root@mid01 zabbix_file]# ls
MySQL-5.5.-.el6.x86_64.rpm-bundle.tar MySQL-test-5.5.-.el6.x86_64.rpm php55w-mysql-5.5.-.w6.x86_64.rpm
MySQL-client-5.5.-.el6.x86_64.rpm php55w-5.5.-.w6.x86_64.rpm php55w-pdo-5.5.-.w6.x86_64.rpm
MySQL-devel-5.5.-.el6.x86_64.rpm php55w-bcmath-5.5.-.w6.x86_64.rpm php55w-xml-5.5.-.w6.x86_64.rpm
MySQL-embedded-5.5.-.el6.x86_64.rpm php55w-cli-5.5.-.w6.x86_64.rpm php-ldap-5.5.-.mga4.x86_64.rpm
MySQL-server-5.5.-.el6.x86_64.rpm php55w-common-5.5.-.w6.x86_64.rpm t1lib-5.1.-.el6_2..x86_64.rpm
MySQL-shared-5.5.-.el6.x86_64.rpm php55w-gd-5.5.-.w6.x86_64.rpm
MySQL-shared-compat-5.5.-.el6.x86_64.rpm php55w-mbstring-5.5.-.w6.x86_64.rpm
共八个rpm包,暂时只需要用到server和client:
[root@mid01 zabbix_file]# rpm -ivh MySQL-server-5.5.-.el6.x86_64.rpm
warning: MySQL-server-5.5.-.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [%]
:MySQL-server ########################################### [%]
[root@mid01 zabbix_file]# rpm -ivh MySQL-client-5.5.-.el6.x86_64.rpm
warning: MySQL-client-5.5.-.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [%]
:MySQL-client ########################################### [%]
不过我把所有mysql rpm包都装了顺序是:
rpm -ivh mysql-community-common-5.7.-.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.-.el6.x86_64.rpm
rpm -ivh mysql-community-client-5.7.-.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.-.el6.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.-.el6.x86_64.rpm
rpm -ivh mysql-community-embedded-5.7.-.el6.x86_64.rpm
rpm -ivh mysql-community-embedded-devel-5.7.-.el6.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.-.el6.x86_64.rpm
rpm -ivh mysql-community-test-5.7.-.el6.x86_64.rpm
查看mysql安装路径:
[root@mid01 zabbix_file]# find / -name mysql -print
/etc/rc.d/init.d/mysql
/etc/logrotate.d/mysql
/usr/lib64/perl5/DBD/mysql
/usr/lib64/perl5/auto/DBD/mysql
/usr/lib64/mysql
/usr/share/mysql
/usr/bin/mysql
/var/lib/mysql
/var/lib/mysql/mysql data默认目录:/var/lib/mysql
mysql默认安装目录:/usr/share/mysql
PS:在mysql5.5 的安装目录里会有多个cnf配置文件,根据需要复制一个到/etc/my.cnf。mysql5.5之后的就默认只有一个配置文件了/etc/my.cnf(linux版本)
设置账号、密码、字符编码:
刚刚安装的mysql不输入密码也可以进入mysql交互界面,重置root有多种方法,这里介绍其中一种:
在my.cnf的[mysqld]下面加一行:skip-grant-tables
然后重启mysql,再进入交互界面重置密码,最后再删了skip-grant-tables
[root@mid01 mysql]# vim /etc/my.cnf
[root@mid01 mysql]# service mysql restart
Shutting down MySQL. [ OK ]
Starting MySQL... [ OK ]
[root@mid01 mysql]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.5.-log MySQL Community Server (GPL) Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> UPDATE user SET password=PASSWORD("zabbix_server") WHERE user='root';
ERROR (3D000): No database selected
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
rows in set (0.00 sec) mysql> use mysql;
Database changed
mysql> UPDATE user SET password=PASSWORD("zabbix_server") WHERE user='root';
Query OK, rows affected (0.00 sec)
Rows matched: Changed: Warnings: mysql> FLUSH PRIVILEGES;
Query OK, rows affected (0.01 sec)
yum -y install gcc+ gcc-c++
zabbix--源码安装部署zabbix3.2的更多相关文章
- Zabbix源码安装部署
zabbix源码部署安装 参考文档:https://www.zabbix.com/documentation/4.0/manual/installation/install https://www ...
- zabbix源码安装实例
环境 系统 Centos7 zabbix版本 Zabbix 3.4.15 (revision 86739) zabbix源码安装 .tar.gz cd zab ...
- zabbix源码安装后,设置为服务启动和关闭
zabbix源码安装,使用service启动与关闭服务 1. zabbix客户端的系统服务脚本 1.1 拷贝启动脚本 zabbix的源码提供了系统服务脚本,在/usr/local/src/zabbix ...
- 在ConoHa上Centos7环境下源码安装部署LNMP
本文记录了从源码,在Centos 7上手动部署LNMP环境的过程,为了方便以后对nginx和mariadb进行升级,这里采用yum的方式进行安装. 1.建立运行网站和数据库的用户和组 groupadd ...
- zabbix源码安装 令人窒息的操作
一.简介 zabbix-server主要分为2部分: zabbix程序 程序根据客户端的监控项,从客户端获取数据并写入到数据库,再根据触发器/动作等配置进行操作. 展示页面 使用php编写,php脚本 ...
- zabbix源码安装
Zabbix通过C/S模式采集数据,通过B/S模式在web端展示和配置. 被监控端:主机通过安装agent方式采集数据,网络设备通过SNMP方式采集数据 Server端:通过收集SNMP和agent发 ...
- piwik源码安装部署
一简单介绍1.piwik介绍Piwik是一个PHP和MySQL的开放源代码的Web统计软件,它给你一些关于你的网站的实用统计报告,比如网页浏览人数,访问最多的页面,搜索引擎关键词等等.Piwik拥有众 ...
- Thingsboard源码安装部署
交流QQ群 如果安装有其他问题,可以到QQ群求助 环境安装 开发环境要求:Jdk 1.8版本Postgresql 9以上Node.jsNpmMaven 3.6以上Git工具Idea开发工具 JDK 下 ...
- Zabbix源码安装,使用service命令管理zabbix进程
1. 前期环境: Zabbix源代码解压包:/root/zabbix-3.0.27 Zabbix安装路径:/usr/local/zabbix-3.0.27 2. 复制启动脚本到 ...
随机推荐
- 20140902 字符串拷贝函数 右旋转字符串 string类的编写
1.strncpy字符串拷贝函数 //strncpy的程序 #include<stdio.h> #include<assert.h> char *strncpy1(char * ...
- 通过rocketmq思考一下mq的设计取舍
1. RocketMQ路由中心NameServer 2. RocketMQ消息发送 3. RocketMQ消息存储 4. RocketMQ消息消费 5. 消息过滤FiterServer 6. Rock ...
- HashMap源码解析笔记
首先简单介绍下HashMap: 1.HashMap有三种数据结构:数组,链表,红黑树. 2.HashMap是非线程安全的 3.HashMap存储的内容是键值对(key-value)映射,key.val ...
- WPF非UI线程访问网络资源造成页面假死现象
公司内部一个项目是用WPF作为GUI 访问web接口的形式获取数据, 但是由于数据量比较大,也没做分页,于是就需要一个loading的控件,网上查了很多资料但都比较浅.这里完成需求后,总结一下. 首先 ...
- android meta_data配置数据
- Input标签文件上传,使用详解
1.html添加标签按钮 <button ion-button (click)="selectVideo()">添加</button> <input ...
- JAVA企业级应用服务器之TOMCAT实战
JAVA企业级应用服务器之TOMCAT实战 链接:https://pan.baidu.com/s/1c6pZjLeMQqc9t-OXvUM66w 提取码:uwak 复制这段内容后打开百度网盘手机App ...
- ORA-01400: cannot insert NULL into
Error text: ORA-01400: cannot insert NULL into when insert into view, NULL value handler in trigger. ...
- java多线程面试题_线程并发面试题
1.什么是线程?线程是操作系统能够进行运算调度的最小单位,它被包含在进程之中,是进程中的实际运作单位.程序员可以通过它进行多处理器编程,你可以使用多线程对运算密集型任务提速.比如,如果一个线程完成一个 ...
- rest framework之过滤组件
一.普通过滤 (一)get_queryset get_queryset方法是GenericAPIView提供的一个方法,旨在返回queryset数据集,而过滤就是要在这个方法返回数据集之前对数据进行筛 ...