Centos6.5安装zabbix 3.0.4 环境篇
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos6.5安装zabbix 3.0.4 环境篇相关的知识,希望对你有一定的参考价值。
CentOS默认情况下提供了一个很老的版本的mysql 5.1。我们需要MySQL5.6以上版本,需要删除旧版本。
[[email protected] ~]# yum list installed | grep mysql mysql-libs.x86_64 [email protected] [[email protected] ~]# yum remove mysql*
配置MySQL源
[[email protected] ~]# rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm Retrieving http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm Preparing...########################################### [100%] 1:mysql-community-release########################################### [100%]
安装MySQL
[[email protected] ~]# yum install mysql-server
查看MySQL版本
[[email protected] ~]# yum list installed | grep mysql 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 [email protected] mysql-community-release.noarch mysql-community-server.x86_64 [email protected]
修改mysql配置文件. /etc/my.cnf,在[mysqld]中添加innodb_file_per_table=1
[[email protected] ~]# 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
启动
[[email protected] ~]# service mysqld start
初始化安全数据库
[[email protected] ~]# mysql_secure_installation
登录数据库
[[email protected] ~]# mysql -u root -p123456
数据库字符集
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 [email protected] IDENTIFIED BY ‘gz‘; Query OK,0 rows affected (0.00 sec)
检查授权是否成功
mysql> show databases; +--------------------+ |Database| +--------------------+ | information_schema | | mysql | | performance_schema | | zabbix | +--------------------+ 4 rows inset(0.00 sec)
Zabbix 3需要php5.4或更高版本。所以配置一个PHP源。
[[email protected] ~]# rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
安装所需的包
[[email protected] ~]# yum install httpd php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap
修改php配置
[[email protected] ~]# 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
[[email protected] ~]# service httpd start
启用端口80上的iptables
[[email protected] ~]# iptables -I INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT [[email protected] ~]# iptables-save > /etc/sysconfig/iptables
本文出自 “何阳光” 博客,请务必保留此出处http://heyangguang.blog.51cto.com/10930823/1894436
以上是关于Centos6.5安装zabbix 3.0.4 环境篇的主要内容,如果未能解决你的问题,请参考以下文章