Centos6.5安装zabbix 3.0.4 环境篇

前端之家收集整理的这篇文章主要介绍了Centos6.5安装zabbix 3.0.4 环境篇前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

CentOS默认情况下提供了一个很老的版本的MysqL 5.1。我们需要MysqL5.6以上版本,需要删除旧版本。

[root@iZ25pvjcsyhZ~]#yumlistinstalled|grepMysqL
MysqL-libs.x86_645.1.73-3.el6_5@updates
[root@iZ25pvjcsyhZ~]#yumremoveMysqL*

配置MysqL

[root@hyg~]#rpm-ivhhttp://dev.MysqL.com/get/MysqL-community-release-el6-5.noarch.rpm
Retrievinghttp://dev.MysqL.com/get/MysqL-community-release-el6-5.noarch.rpm
Preparing...###########################################[100%]
1:MysqL-community-release###########################################[100%]

安装MysqL

[root@hyg~]#yuminstallMysqL-server

查看MysqL版本

[root@hyg~]#yumlistinstalled|grepMysqL
MysqL-community-client.x86_64
5.6.32-2.el6@MysqL56-community
MysqL-community-common.x86_64
5.6.32-2.el6@MysqL56-community
MysqL-community-libs.x86_64
5.6.32-2.el6@MysqL56-community
MysqL-community-release.noarch
MysqL-community-server.x86_64
5.6.32-2.el6@MysqL56-community

修改MysqL配置文件. /etc/my.cnf,在[MysqLd]中添加innodb_file_per_table=1

[root@hyg~]#vim/etc/my.cnf


[MysqLd]
datadir=/var/lib/MysqL
socket=/var/lib/MysqL/MysqL.sock
innodb_file_per_table=1
symbolic-links=0
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[MysqLd_safe]
log-error=/var/log/MysqLd.log
pid-file=/var/run/MysqLd/MysqLd.pid

启动

[root@hyg~]#serviceMysqLdstart

初始化安全数据库

[root@hyg~]#MysqL_secure_installation

登录数据库

[root@hyg~]#MysqL-uroot-p123456

数据库字符集

MysqL>CREATEDATABASEzabbixCHARACTERSETutf8COLLATEutf8_bin;
QueryOK,1rowaffected(0.00sec)

创建一个数据库用户,设置密码和授予特权。

MysqL>GRANTALLPRIVILEGESONzabbix.*TOzabbix@localhostIDENTIFIEDBY'gz';
QueryOK,0rowsaffected(0.00sec)

检查授权是否成功

MysqL>showdatabases;
+--------------------+
|Database|
+--------------------+
|information_schema|
|MysqL|
|performance_schema|
|zabbix|
+--------------------+
4rowsinset(0.00sec)

Zabbix 3需要PHP5.4或更高版本。所以配置一个PHP源。

[root@hyg~]#rpm-ivhhttp://repo.webtatic.com/yum/el6/latest.rpm

安装所需的包

[root@hyg~]#yuminstallhttpdPHP56wPHP56w-gdPHP56w-MysqLPHP56w-bcmathPHP56w-mbstringPHP56w-xmlPHP56w-ldap

修改PHP配置

[root@hyg~]#vim/etc/PHP.ini
post_max_size=16M
max_execution_time=300
max_input_time=300
date.timezone=Asia/Shanghai
always_populate_raw_post_data=-1

启动web

[root@hyg~]#servicehttpdstart

启用端口80上的iptables

[root@hyg~]#iptables-IINPUT-ptcp--dport80-mstate--stateNEW,ESTABLISHED-jACCEPT
[root@hyg~]#iptables-save>/etc/sysconfig/iptables
原文链接:https://www.f2er.com/centos/378890.html

猜你在找的CentOS相关文章