[Zabbix] Server 安装

一、系统环境

角色

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


完成图:




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值