CentOS6.6 for Zabbix install

[base]
cat /etc/issue
centos 6.6
service iptables stop
vim /etc/sysconfig/selinux
----------------
SELINUX=disabled
----------------

[creat zabbix user and group]
groupadd zabbix
useradd –g zabbix zabbix

[install apache]
yum install httpd libxml2-devel net-snmp-devel libcurl-devel
vim /etc/httpd/conf/httpd.conf
----------------------------------
DocumentRoot "/var/www/html/zabbix"
<Directory "/var/www/html/zabbix">
ServerName 127.0.0.1:80
DirectoryIndex index.html index.html.var index.php
--------------------------------------------------
mkdir -p /var/www/html/zabbix

[install php]
rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
yum -y install httpd php56w php56w-gd php56w-mysqlnd php56w-bcmath php56w-mbstring php56w-xml php56w-ldap
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
------------------------------------

[install mysql]
rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum install –y mysql-server mysql-devel
vim /etc/my.cnf
---------------
default-storage-engine = innodb
innodb_file_per_table          
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8
-----------------------------
service mysqld start
mysql_secure_installation
Set root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

[creat zabbix database]
[root@linuxtest zabbix]# mysql -uroot -p
Enter password: 
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> show create database zabbix;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> flush privileges;
mysql> show databases;
mysql> quit;

[zabbix-3.4.4 install]
wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.4/zabbix-3.4.4.tar.gz
tar -zxvf zabbix-3.4.4.tar.gz

[Import the configuration to the database]
cd zabbix-3.4.4/database/mysql
[root@linuxtest mysql]# mysql -uroot -hlocalhost -p zabbix <schema.sql
Enter password: 123.com
[root@linuxtest mysql]# mysql -uroot -hlocalhost -p zabbix <images.sql
Enter password: 123.com
[root@linuxtest mysql]# mysql -uroot -hlocalhost -p zabbix <data.sql
Enter password: 123.com

[zabbix install]
yum -y install gcc mysql-community-devel libxml2-devel unixODBC-devel net-snmp-devel libcurl-devel libssh2-devel OpenIPMI-devel openssl-devel openldap-devel
yum -y install libevent libevent-devel pcre pcre-devel
cd /root/software/zabbix/zabbix-3.4.4
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-ssh2 --with-openipmi --with-openssl --prefix=/usr/local/zabbix
***********************************************************
*            Now run 'make install'                       *
*                                                         *
*            Thank you for using Zabbix!                  *
*              <http://www.zabbix.com>                    *
***********************************************************
make install

[modify zabbix_server.conf]
mkdir –p /var/log/zabbix
touch /var/log/zabbix/zabbix_server.log
vim /usr/local/zabbix/etc/zabbix_server.conf
----------------
DBName=zabbix
DBUser=zabbix
DBPassword=123.com
LogFile=/var/log/zabbix/zabbix_server.log
-------------------------------------------
cp -a /root/software/zabbix/zabbix-3.4.4/frontends/php/* /var/www/html/zabbix/
cp /root/software/zabbix/zabbix-3.4.4/misc/init.d/fedora/core/* /etc/init.d/
chkconfig --add /etc/init.d/zabbix_server
chkconfig --add /etc/init.d/zabbix_agentd
chkconfig httpd on
chkconfig mysqld on
chkconfig zabbix_server on
chkconfig zabbix_agentd on

[modify]
vim /etc/init.d/zabbix_server
vim /etc/init.d/zabbix_agentd
--------------------------
BASEDIR=/usr/local/zabbix
--------------------------

[start service]
service httpd start
cd /etc/init.d/
./zabbix_server start

[creat start script]
touch /root/zabbix_start.sh
-----------------------------------------------------------
#!/bin/bash
echo '(1)start      (2)restart      (3)stop      (4)quit'
echo 'Please select the function you need:'
read state
file='/etc/init.d/'
if [ "1" -eq "$state" ];then
        cd $file
        ./zabbix_server start
fi
if [ "2" -eq "$state" ];then
        cd $file
        ./zabbix_server restart
fi
if [ "3" -eq "$state" ];then
        cd $file
        ./zabbix_server stop
fi
if [ "4" -eq "$state" ];then
        exit
fi
------------------------------------------------------------

[visit zabbix web page]
http://192.168.75.128/setup.php
default login account:Admin
default login password:zabbix

[solve problems]
number 1:
zabbix server is not running......
can't connect to this database 'zabbix@localhost' eq.....
WAY:
modify your zabbix_server.conf
vim /usr/local/zabbix/etc/zabbix_server.conf
---------------
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBPort=3306
ListenIP=192.168.75.128
-------------------------
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值