你的位置:首页 > 操作系统

[操作系统]Centos6.7 安装zabbix+apache+mysql教程


Centos6.7 安装zabbix+apache+mysql教程

blog地址: http://www.cnblogs.com/caoguo

### 基本包安装 ###[root@ca0gu0 ~]# yum install httpd php php-devel mysql-server mysql-devel[root@ca0gu0 ~]# yum install libdevel[root@ca0gu0 ~]# yum install php-mysql php-bcmath php-mbstring php-gd libjpeg libjpeg-devel libpng libpng-devel php-~]# yum install gcc make wget

 

###### zabbinx 编译安装 ######[root@ca0gu0 src]# wget http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.10/zabbix-2.2.10.tar.gz[root@ca0gu0 ~]# groupadd zabbix[root@ca0gu0 ~]# useradd -g zabbix zabbix -M -s /sbin/nologin[root@ca0gu0 src]# tar zxvf zabbix-2.2.10.tar.gz[root@ca0gu0 src]# cd /usr/local/src[root@ca0gu0 src]# cd zabbix-2.2.10[root@ca0gu0 zabbix-2.2.10]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libipv6[root@ca0gu0 zabbix-2.2.10]# make install[root@ca0gu0 zabbix-2.2.10]# ln -s /usr/local/zabbix/sbin/zabbix_server /usr/local/sbin/[root@ca0gu0 zabbix-2.2.10]# ln -s /usr/local/zabbix/sbin/zabbix_agentd /usr/local/sbin/[root@ca0gu0 zabbix-2.2.10]# cp misc/init.d/fedora/core/zabbix_server /etc/init.d/[root@ca0gu0 zabbix-2.2.10]# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/[root@ca0gu0 ~]# /etc/init.d/zabbix_server startStarting zabbix_server:                  [ OK ][root@ca0gu0 zabbix-2.2.10]# vi /usr/local/zabbix/etc/zabbix_server.confLogFile=/tmp/zabbix_server.logDBName=zabbix_dbDBUser=zabbix_userDBPassword=zabbix_passwd[root@ca0gu0 zabbix-2.2.10]# /etc/init.d/zabbix_server restart[root@ca0gu0 zabbix-2.2.10]# mkdir -p /var/www/html/zabbix[root@ca0gu0 zabbix-2.2.10]# cp -a frontends/php/* /var/www/html/zabbix

 

 

####建立数据库并导入数据#####mysql> create database zabbix_db;mysql> grant all on zabbix_db.* to 'zabbix_user'@'localhost' identified by 'zabbix_passwd';mysql> flush privileges;[root@ca0gu0 zabbix-2.2.10]# mysql -uzabbix_user -pzabbix_passwd zabbix_db <database/mysql/schema.sql [root@ca0gu0 zabbix-2.2.10]# mysql -uzabbix_user -pzabbix_passwd zabbix_db<database/mysql/images.sql[root@ca0gu0 zabbix-2.2.10]# mysql -uzabbix_user -pzabbix_passwd zabbix_db <database/mysql/data.sql

 

# 登陆地址http://localhost/zabbixAdmin/zabbix

 

# 添加开机启动项[root@ca0gu0 ~]# chkconfig httpd on[root@ca0gu0 ~]# chkconfig mysqld on[root@ca0gu0 ~]# chkconfig zabbix_server on

 

下面看登陆web初始化

 

 

 

 

 

 

 

 

 

结束安装!!!