安装CENTOS7并完成用户名密码的设置建立
执行管理员权限常态:
sudo su
userpassword:
一、关闭防火墙
systemctl stop firewalld.service
禁止firewall开机启动
systemctl disable firewalld.service
二、关闭SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注释掉
#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
:wq! 保存退出
setenforce 0 使配置立即生效
三、更新yum
yum install net-tools
yum install wget
wget -q -O - http://www.atomicorp.com/installers/atomic | sh
安装Apache(httpd)
yum install httpd -y
systemctl start httpd.service
systemctl stop httpd.service
systemctl restart httpd.service
systemctl enable httpd.service
安装Mysql
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server
service mysqld restart
设置密码的方法:
mysql -uroot #进入数据库
mysql> set password for root@localhost= password('zabbix');
添加zabbix
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
create database zabbix;
use zabbix;
exit
安装PHP
yum install php -y
安装PHP组件,使PHP支持 Mysql
yum install php-mysql php-gdlibjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash -y
systemctl restart mysql.service 重启mysql
systemctl restart httpd.service 重启Apache
Apache配置
vi /etc/httpd/conf/httpd.conf
#AddHandlercgi-script .cgi #修改为:AddHandlercgi-script .cgi .pl (允许扩展名为.pl的CGI脚本运行)
#Options Indexes FollowSymLinks #修改为 Options FollowSymLinks(不在浏览器上显 示树状目录结构)
DirectoryIndex index.html #修改为:DirectoryIndex index.html index.htm Default.html Default.htm index.php(设置默认首页文件,增加index.php)
:wq! #保存退出
systemctl restart httpd.service #重启apache
rm -f /etc/httpd/conf.d/welcome.conf /var/www/error/noindex.html #删除默认测试页
php配置
vi /var/www/html/index.php
输入:
<?php
phpinfo();
?>
:wq! #保存退出
源安装:
rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
zabbix数据库组件安装:
yum install zabbix-server-mysql zabbix-web-mysql -y
zabbix组件安装:
yum install zabbix-agent
向数据库中导入表
cd /usr/share/doc/zabbix-server-mysql-3.0.2
zcat create.sql.gz | mysql -uroot -pzabbix zabbix
修改配置文件
# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
启动zabbix
systemctl start zabbix-server
systemctl start zabbix-agent
修改时区时间
vi etc/httpd/conf.d/zabbix.conf
# p
hp_value date.timezone Europe/Riga修改为php_value date.timezone Asia/Shanghai
:wq!
修改中文语言
vi /usr/share/zabbix/include/locales.inc.php
'zh_CN' => ['name' => _('Chinese (zh_CN)'), 'display' => false]
修改fales为true
导入其他中文字体
从windows下控制面板->字体->选择一种中文字库例如“楷体”
把字体放到Zabbix的网站的fonts目录下,如:/usr/share/zabbix/fonts/
修改配置:vi /usr/share/zabbix/include/defines.inc.php
修改FONT_NAME GRAPH_FONT_NAME
重新刷新Zabbix图形就可以正常显示中文字体
启动阿帕奇
systemctl start httpd
设置自启动
启动zabbix服务
service start zabbix_agent
service start zabbix_server
systemctl enable zabbix-agent #设置开机启动
systemctl enable zabbix-server #设置开机启动
在浏览器输入:http://ip/zabbix
Zabbix 3.0 设置邮件报警