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>create database zabbix character set utf8;
MysqL> GRANT ALL PRIVILEGES on zabbix.* to zabbix@localhost 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
# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=密码
启动Zabbix服务进程:
#server zabbix-server start
#ss -tnl
[root@zabbix ~]# ss -tnl | grep :10051
LISTEN 0 128 :::10051 :::*
LISTEN 0 128 *:10051 *:*
#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
############################################可选配置#############################################################
#groupadd zabbix
#useradd -g zabbix -m zabbix