This tutorial is to install Zabbix through the source code method
System Software Installation Environment:
Linux system version: CentOS 6.4 X64zabbix version: zabbix-2.4.1.tar.gzzabbix:http://nchc.dl.sourceforge.net/project/zabbix/zabbix% 20latest%20stable/2.4.1/zabbix-2.4.1.tar.gz
CentOS 6.4 Install MySQL installation method
The Zabbix server needs to run in a lamp or LNMP environment.
Dependency packages required to install zabbix2.x
[[email protected] ~]# yum-y install gcc gcc-c++ autoconf httpd php mysql mysql-server php-mysql httpd-manualmod_ssl mod_ Perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel Libdi-bdbi-mysql net-snmp-devel curl-devel unixodbc-devel openipmi-devel java-devel openldap openldap-devel Libssh2-devel
Modify the environment that PHP needs to configure
Date.timezone = Asia/shanghaimax_execution_time = 300post_max_size = 32mmax_input_time = 300memory_limit = 128mmbstring.func_overload = 2
Add Zabbix User
[Email protected] ~]# groupadd zabbix-g 201[[email protected] ~]# useradd-g zabbix-u 201-m Zabbix
Download Ann zabbix2.x Pack
[Email protected] ~]# wget HTTP://NCHC.DL.SOURCEFORGE.NET/PROJECT/ZABBIX/ZABBIX%20LATEST%20STABLE/2.4.1/ Zabbix-2.4.1.tar.gz[[email protected] ~]# tar zxvf zabbix-2.4.1.tar.gz[[email protected] ~]# CD zabbix-2.4.1 compile and install Zabbix. /configure--prefix=/usr/local/zabbix--enable-server--enable-proxy--enable-agent--with-mysql--WITH-NET-SNMP-- With-libcurl--with-openipmi--with-unixodbc--with-ldap--with-ssh2--enable-java Note: Here all the functions are installed, so add more parameters, if only install the server, You only need to turn on--enable-server. If the installation lacks a corresponding dependency package, Yum installs the missing software name. [[email protected] zabbix-2.4.1]# make && make install
Preparing the MySQL Database
Database installation can be viewed
[Email protected] zabbix-2.4.1]# mysqlmysql> CREATE database Zabbix character Set utf8;mysql> grant all privileges On zabbix.* to [email protected] identified by ' Zabbix ';mysql> flush privileges;mysql> quit
Import Database
[Email protected] zabbix-2.4.1]# Mysql-uzabbix-pzabbix Zabbix < Database/mysql/schema.sql[[email protected] zabbix-2.4.1]# Mysql-uzabbix-pzabbix Zabbix < database/mysql/images.sql[[email protected] zabbix-2.4.1]# mysql- Uzabbix-pzabbix Zabbix < Database/mysql/data.sql
Copy Service startup scripts
[[email protected] zabbix-2.4.1]# CP misc/init.d/fedora/core/zabbix_*/etc/init.d/[[email protected] zabbix-2.4.1]# chmod 755/etc/init.d/zabbix_*[[email protected] zabbix-2.4.1]# vim/etc/init.d/zabbix_server Modify the installation directory to Zabbix: basedir= /usr/local/zabbix[[email protected] zabbix-2.4.1]# vim/etc/init.d/zabbix_agentd Modify the installation directory to Zabbix: basedir=/usr/local/ Zabbix
Configuring Zabbix_server.conf server-side files
[Email protected] zabbix-2.4.1]# vim/usr/local/zabbix/etc/zabbix_ Server.conf Modify the following three items, change to add the MySQL database Zabbix library user name password Dbname=zabbixdbuser=zabbixdbpassword=zabbix
Copy the Zabbix Web file to the Apache directory
[Email protected] zabbix-2.4.1]# cp-r frontends/php//var/www/html/[[email protected] zabbix-2.4.1]# mv/var/www/html/ php//var/www/html/zabbix[[email protected] zabbix-2.4.1]# chown-r apache.apache/var/www/html/zabbix/
Open Zabbix Service
[[Email protected] zabbix-2.4.1]# service zabbix_server startstarting zabbix_server:/usr/local/zabbix/sbin/zabbix_ Server:error while loading Sharedlibraries:libmysqlclient.so.18:cannot open shared object file:no such file or Directo Ry[failed] Workaround: [[email protected] zabbix-2.4.1]# ln-s/usr/local/mysql/lib/libmysqlclient.so.18/usr/lib64/[[email Protected] zabbix-2.4.1]# service zabbix_server startstarting zabbix_server: [OK][[email protected] zabbix-2.4.1]# Serv Ice httpd start
Here Zabbix server side of the installation is complete, the next browser for Web configuration Http://127.0.0.1/zabbix.
Zabbix Tutorial-centos6.x Source Installation zabbix2.x method