CentOS 6.5 + LAMP 安装Zabbix 3.0
关闭:iptables&Selinux服务
#iptables -F
#iptables -nv -L
查看SELinux状态:
/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
SELinux status: enabled
#getenforce ##也可以用这个命令检查
#setenforce 0 ##设置SELinux 成为permissive模式
修改Selinux配置,重启生效:
#vim /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
#################################LAMP##################################################
Linux版本:
CentOS 6.5 X86_64
Apache版本:
Server version: Apache/2.2.15 (Unix)
Server built: May 11 2016 19:28:33
MySQL版本:
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
PHP版本:( zabbix_3.0 要求php版本至少在5.4以上 )
PHP 5.4.45 (cli) (built: Oct 16 2015 11:24:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
1.安装LAMP
安装PHP5.4
rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm
# yum install httpd httpd-devel
# yum install mysql mysql-server
# yum install php54w php54w-cli php54w-common php54w-devel php54w-pear php54w-gd php54w-mbstring php54w-mysql php54w-xml php54w-bcmath
测试web&mysql服务:
# service httpd start
# service mysqld start
#############################Zabbix 3.0安装#######################################################
CentOS/RHEL 6:
wget http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm
或如下:
# rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm
# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway
登录数据库,创建帐号和设置权限:
mysql> use mysql;
mysql>create database zabbix character set utf8;
mysql> GRANT ALL PRIVILEGES on zabbix.* to [email protected] IDENTIFIED BY ‘密码‘;
mysql> FLUSH PRIVILEGES;
mysql> quit
导入Zabbix数据库模板:
# cd /usr/share/doc/zabbix-server-mysql-3.0.0
# zcat create.sql.gz | mysql -uroot zabbix
修改Zabbix配置文件的数据库对应参数:
# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=密码
启动Zabbix服务进程:
#server zabbix-server start
#ss -tnl
[[email protected] ~]# ss -tnl | grep :10051
LISTEN 0 128 :::10051 :::*
LISTEN 0 128 *:10051 *:*
修改php.ini参数:
#vim /etc/php.ini
max_execution_time 300 (默认为30)
memory_limit 128M
post_max_size 16M
upload_max_filesize 2M
max_input_time 300 (默认为60)
always_populate_raw_post_data -1
date.timezone = RPC (默认为空)
重启httpd服务,并访问Zabbix-web服务:
#service httpd restart
http://zabbix-web-hostIP/zabbix
############################################可选配置#############################################################
增加zabbix用户和组
#groupadd zabbix
#useradd -g zabbix -m zabbix