Centos6.8 安裝Zabbix3.4


一、部署zabbix

1、下載軟件包

https://www.zabbix.com/download_sources

2、安裝mysql5.6,由於Centos6.8默認安裝的版本是5.1的,故要先卸載再安裝5.6版本的

yum remove mysql* -y

3、配置mysql5.6的源

vim /etc/yum.repos.d/mysql.repo

[mysql56]  
name=MySQL 5.6 Community Server  
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/  
enabled=1  
gpgcheck=0  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

#yum clean all

#yum makecache

安裝mysql

yum install mysql-community-server -y

#配置my.cnf

#vi /etc/my.cnf
[mysqld]
innodb_file_per_table=1  #增加這一行代碼

4、安裝php5.6和Apache服務

#獲取yum源
rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
yum clean all
yum makecache

#安裝下列所有包
yum search httpd php56w php56w-gd php56w-mysqlnd php56w-bcmath php56w-mbstring php56w-xml php56w-ldap
yum -y install httpd php56w php56w-gd php56w-mysqlnd php56w-bcmath php56w-mbstring php56w-xml php56w-ldap

#編輯php的ini文件
vim /etc/php.ini

max_execution_time = 300
max_input_time = 300
date.timezone = Asia/Shanghai
always_populate_raw_post_data = -1

#配置/etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html/zabbix"
<Directory "/var/www/html/zabbix">
ServerName 127.0.0.1
DirectoryIndex index.html index.html.var index.php

#設置web前端
mkdir /var/www/html/zabbix
cp -a zabbix-3.4.3/frontends/php/ /var/www/html/zabbix

#設置apache的執行和所有者
chown -R apache:apache /var/www/html/zabbix

#賦予可執行權限
chmod +x /var/www/html/zabbix/conf/

5、創建zabbix用戶和組

groupadd zabbix
useradd -g zabbix zabbix

6、編譯安裝zabbix

groupadd zabbix
useradd -g zabbix zabbix
yum install gcc* mysql-devel libxml2-devel net-snmp* java* curl-devel -y
yum install libdbi-dbd-mysql net-snmp-devel curl-devel net-snmp libcurl-devel libxml2-devel ncurses-devel libssh2-devel OpenIPMI-devel iksemel-devel  libxml2-devel  unixODBC-devel OpenIPMI-devel curl-devel libevent-devel pcre pcre-devel -y

#編譯安裝
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --enable-java --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-ssh2 --with-openipmi --with-openssl --prefix=/usr/local/zabbix

#編譯成功
*******************************************************
*            Now run 'make install'                       *
*                                                         *
*            Thank you for using Zabbix!                  *
*              <http://www.zabbix.com>                    *
*******************************************************

 











 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM