借鉴链接http://blog.csdn.net/su1322339466/article/details/53869738
安装准备
vi /etc/sysconfig/selinux
SELINUX=disabled
SELINUX=enforcing
防火墙是否开启
关闭防火墙
[root@localhost ~]# /etc/init.d/iptables stop 关闭防火墙
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@localhost ~]# /etc/init.d/iptables status 查看防火墙的状态
iptables: Firewall is not running.
setenforce 0 临时关闭
getenforce 0
安装PHP
2 rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
3 yum install php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap
配置
4 vim /etc/php.ini
date.timezone = Asia/Shanghai post_max_size = 32M max_execution_time = 300 max_input_time = 300 always_populate_raw_post_data = -1
安装MySQL
6 rpm -qa |grep mysql 检查是否存在mysql
7 rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
8 yum install -y mysql-server mysql-devel 安装MySQL-server
14 service mysqld start 启动服务
15 mysql -uroot -p 默认密码为空
16 mysql -uzabbix -pmysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
mysql> grant all privileges on zabbix.* to'zabbix'@'%' identified by 'zabbix';
mysql> flush privileges;
mysql> show databases;
+---Database information_schema mysql performance_schema zabbix
安装zabbix
19 yum install httpd libxml2-devel net-snmp-devel libcurl-devel
20 groupadd -g 201 zabbix
21 useradd -g zabbix -u 201 -m zabbix
利用winSCP手动放入zabbix-3.2.1.tar.gz在/root根目录
24 tar zxvf zabbix-3.2.1.tar.gz
25 cd zabbix-3.2.1
导入表结构
26 /usr/bin/mysql -uzabbix -pzabbix zabbix < database/mysql/schema.sql
27 /usr/bin/mysql -uzabbix -pzabbix zabbix < database/mysql/p_w_picpaths.sql
28 /usr/bin/mysql -uzabbix -pzabbix zabbix < database/mysql/data.sql
29 ./configure --prefix=/usr/local/zabbix --sysconfdir=/etc/zabbix/ --enable-server --enable-agent --with-net-snmp --with-libcurl --with-mysql --with-libxml2
30 make &&make install
31 vim /etc/zabbix/zabbix_server.conf
35 ln -s /usr/local/zabbix/sbin/* /usr/sbin/
39 cp /root/zabbix-3.2.1/misc/init.d/fedora/core/zabbix_* /etc/init.d/
40 chmod +x /etc/init.d/zabbix_*
41 sed -i "s@BASEDIR=/usr/local@BASEDIR=/usr/local/zabbix@g" /etc/init.d/zabbix_server
42 vim /etc/httpd/conf/httpd.conf
43 mkdir -p /var/www/html/zabbix
44 cp -r /root/zabbix-3.2.1/frontends/php/* /var/www/html/zabbix/
45 chown -R apache.apache /var/www/html/zabbix/
46 chkconfig zabbix_server on
47 /etc/init.d/zabbix_server start
48 service httpd restart
chkconfig httpd on
chkconfig zabbix_server on
chkconfig mysqld on
http://ip/zabbix