当前位置: 首页 > Zabbix > 正文

[Zabbix] Server Install

http://blog.csdn.net/m0_37313242/article/details/76576159

一、系统环境

角色

IP

服务 端口

zabbix-server
zabbix-web

192.168.1.201
(rhel 7.2)

mariadb5.5.52/Apache2.4.6/php 5.4.16/zabbix-server 3.2.4/zabbix-agent 3.2.4

3306\80\10051\10050

 

二、初始化系统

1、配置系统yum 163

#  cd /etc/yum.repos.d

#wget http://mirrors.163.com/.help/CentOS7-Base-163.repo        # $releasever替换成相应版本 7

# yum clean all && yum makecache           (yumrepolist)

2、配置zabbix yum

#rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm

# more /etc/yum.repos.d/zabbix.repo

[zabbix]

name=Zabbix Official Repository – $basearch

baseurl=http://repo.zabbix.com/zabbix/3.2/rhel/7/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

 

[zabbix-non-supported]

name=Zabbix Official Repository non-supported – $basearch

baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX

gpgcheck=1

# yum repolist

3、关闭防火墙等

# systemctl disable firewalld && systemctl stop firewalld

# vi /etc/selinux/config

SELINUX=disabled

三、安装 Mariadb

1yum安装

yum -y install mariadb*

 

2、自启

systemctl enable mariadb

systemctl start mariadb

 

3、配置mysql密码

mysql_secure_installation

 

4、登入验证

mysql -uroot -ppassword

四、安装Apache

1yum安装httpd

#yum -y install httpd

2、自启

#systemctl enable httpd

#systemctl start httpd

 

五、安装PHP

1yum安装php

# yum -y install php

#yum -y install php-mysql     #用于让PHP程序使用MySQL数据库的模块

 

2、重启httpd,使php生效

# systemctl restart httpd

3、相关目录说明

/etc/httpd/conf.d/php.conf   #apache所读取的php配置文件

/etc/php.ini                               #php本身的配置文件

/etc/httpd/conf.modules.d/10-php.conf     #apache 加载的php模块文件

 

4、测试php

# more/var/www/html/phpinfo.php

<?php phpinfo();   ?>

 

URL登入:http://192.168.1.201/phpinfo.php

 

六、安装Zabbix-Server

1、导入zabbix包(前面已经做过了)

#rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm

 

2yum安装

#yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get zabbix-sender

 

3、初始化数据库

#mysql -uroot -ppassword

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’zabbix’;   //密码是 zabbix

Query OK, 0 rows affected (0.00 sec)

mysql> quit
By
e

 

#cd /usr/share/doc/zabbix-server-mysql-3.2.4/

#zcat create.sql.gz | mysql -uzabbix -p zabbix  #导入zabbix数据文件

#mysql -uzabbix -pzabbix

#验证zabbix

# use zabbix;

# show tables;

 

4、配置zabbix-server

# vi /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=password

 

 

vi /etc/httpd/conf.d/zabbix.conf

<Directory “/usr/share/zabbix”>

Options FollowSymLinks

AllowOverride None

Require all granted

 

<IfModule mod_php5.c>

php_value max_execution_time 300

php_value memory_limit 128M

php_value post_max_size 16M

php_value upload_max_filesize 2M

php_value max_input_time 300

php_value always_populate_raw_post_data -1

php_value date.timezone Asia/Shanghai

</IfModule>

</Directory>

 

5、自启

#systemctl restart zabbix-server

#systemctl enable zabbix-server

 

6、登入zabbix web界面并配置

# url: http://192.168.1.201/zabbix/setup.php

#默认账号密码:  Admin     zabbix

过程图:

注意:若有[][][]乱码,则按以下处理:

Win + R打开运行输入 fonts

回车进入Windows字体目录,找到微软雅黑-常规字体,复制出来将文件名修改为msyh.ttf,然后上传到/usr/share/zabbix/fonts

 

上传成功以后,修改defines.inc.php的第45行,将graphfont改为msyh

vim /usr/share/zabbix/include/defines.inc.php

 

完成图:

本文固定链接: http://t.yjsec.com/index.php/2017/12/19/201/ | 下一站

该日志由 admin 于2017年12月19日发表在 Zabbix 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: [Zabbix] Server Install | 下一站

[Zabbix] Server Install:等您坐沙发呢!

发表评论

快捷键:Ctrl+Enter