zabbix3.0 Installing the deployment documentation

Source: Internet
Author: User
Tags php download

Zabbix v3.0 Installation Deployment Summary:

The installation process of this article is from http://www.ttlsa.com/and http://b.lifec-inc.com, and webmaster Cheng "Zabbix from the beginning to master v3.0.1-operation Survival Time (2016)" a book.

About Zabbix and related services software versions:
6.6 Nginx: 1.9.  the MySQL: 5.5.  the PHP: 5.5.  *
First, install the Nginx: Install the dependent package:
Yum-y install gcc gcc-c++ autoconf automake zlib zlib-devel OpenSSL openssl-devel pcre* make Gd-devel libjpeg-devel LIBPN G-devel Libxml2-devel Bzip2-devel Libcurl-devel
To create a user:
Useradd nginx-s/sbin/nologin-m
Download the Nginx package and go to the directory:
wget http://nginx.org/download/nginx-1.9.15.tar.gz && tar xvf nginx-1.9.15.tar.gz && CD nginx-1.9.15
Compile:
./configure--prefix=/usr/local/product/nginx1. 9.14 --user=www--group=www--with-http_ssl_module--with-http_v2_module--with-http_stub_status_module-- With-pcre

Make && make install
Ln-s/usr/local/product/nginx1.9.14/usr/local/nginx ==> Creating a soft link

Parameter explanation:
--with-http_stub_status_module: Support nginx status query --with-http_ssl_module: Support HTTPS--with-http_spdy _module: Support Google's spdy, want to know please Baidu Spdy, this must have SSL support --with-pcre: In order to support rewrite rewrite function, must develop PCRE

Second, install PHP download PHP installation package:
wget http://cn2.php.net/get/php-5.5.35.tar.gz/from/this/mirror
Unzip and compile:
MV Mirror php-5.5. *. tar.gz && Tar xvf php-5.5. *. tar.gz && CD php-5.5. *./configure--prefix=/usr/local/product/php-5.5. *--with-config-file-path=/usr/local/product/php-5.5. */etc--with-bz2--with-curl--enable-ftp--enable-sockets--disable-ipv6--with-gd--with-jpeg-dir=/usr/local-- With-png-dir=/usr/local--with-freetype-dir=/usr/local--enable-gd-native-ttf--with-iconv-dir=/usr/local-- Enable-mbstring--enable-calendar--with-gettext--with-libxml-dir=/usr/local--with-zlib--with-pdo-mysql=mysqlnd- -with-mysqli=mysqlnd--with-mysql=mysqlnd--enable-dom--enable-xml--enable-fpm--with-libdir=lib64--enable-bcmath

Make && make install
Ln-s/usr/local/product/php-5.5.35/usr/local/php

CP Php.ini-production/usr/local/php/etc/php.ini
cd/usr/local/php/etc/

CP Php-fpm.conf.default php-fpm.conf

Modify the php.ini parameter: (Zabbix environment requires modified parameters)
= == = PRC

Third, install MySQL add MySQL user, create MySQL Data directory:
-pv/data/-r-g mysql-d/data/mysql-s/sbin/-R mysql.mysql/data/mysql

Install CMake and dependencies:

Download the MySQL installation package:
wget http://dev.mysql.com/get/downloads/mysql-5.5/mysql-5.5.49.tar.gz

Compile and install MySQL:
TAR-XVF mysql-5.5. tar.gz && cd mysql-5.5.  the  -dcmake_install_prefix=/usr/local/product/mysql5. 5.49 -ddefault_charset=utf8-denabled_local_infile=1 -dmysql_datadir=/data/mysql-dwith_extra_ charsets=all-dwith_readline=1 -dwith_innobase_storage_engine=1 -dmysql_tcp_port=3306 - Ddefault_collation=utf8_general_ci


Make && make install

Ln-s/usr/local/product/mysql5.5.49/usr/local/mysql

Chown-r Mysql.mysql/usr/local/mysql

Copy the MySQL configuration file:
cd/usr/local/mysql/support-files/cp my-medium.cnf/data/mysql//etc/init.d/+x/etc/ Init.d/mysqld

Initialize MySQL:
cd/usr/local/mysql/scripts. /mysql_install_db--user=mysql--basedir=/usr/local/mysql/--datadir=/data/mysql/

To modify the data directory in MySQL configuration file my.cnf:
datadir=/data/mysql/

Start MySQL:
[Email protected] ~]#/etc/init.d/mysqld startstarting MySQL ... SUCCESS!

Log in to the database and create the Zabbix database and user name and password:
 mysql> CREATE database Zabbix default   CharSet UTF8; Query OK,  1  row affected (0.00  Span style= "color: #000000;" > sec) MySQL  > Grant all privileges the zabbix.* to [Email protected] "  localhost   " identified by  '  

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| MySQL |
| Performance_schema |
| Test |
| Zabbix |
+--------------------+
5 rows in Set (0.00 sec)

If there is a problem logging on to the database:
[Email protected] ~2002 (HY000): Can'/var/lib/mysql/ Mysql.sock'  (2)~]# ln-s/tmp/mysql.sock/var/lib/mysql/
Create a password for the root of the database:
[Email protected] zabbix-3.0. 3] # mysqladmin-uroot Password  "Zabbix"

Iv. Installing Zabbix server: Installing Zabbix:
-rw-r--r--   1 root root  15407273 May   zabbix-3.0.  3~]# tar zxf zabbix-3.0. 3. tar.gz && CD zabbix-3.0. 3 compile Zabbix:. /configure--prefix=/usr/local/zabbix-3.0. 3/--enable-server--enable-agent--with-mysql--with-net-snmp--with-libcurl--with-& & Make Install

If there is an error during the compilation process:
 for mysql_config Noconfigure:error:MySQL Library not found solution: Yum install MySQL-devel- for NE t-snmp-config ... noconfigure:error:Invalid Net-snmp directory-unable to find net-snmp-config fix: Yum Insta ll Net-snmp-devel-y

To create a Zabbix user:
[Email protected] zabbix-3.0. 3 ]# groupadd zabbix[[email protected] Zabbix-3.0. 3] # Useradd Zabbix-s/sbin/nologin-m-G
Zabbix server needs to import 3 SQL files:
[Email protected] zabbix-3.0. 3] # Mysql-uroot-pzabbix Zabbix < database/mysql/Schema.sql [[email protected] Zabbix-3.0.  3]# Mysql-uroot-pzabbix Zabbix < database/mysql/Images.sql [[email protected] Zabbix-3.0.  3

[Email protected] zabbix-3.0.3]# pwd
/root/zabbix-3.0.3

V. Zabbix Management website Configuration (nginx): Create a project directory:
[Email protected] zabbix-3.0. 3] # mkdir/data/web/zabbix.lifec.com-p[[email protected] Zabbix-3.0.  3]# Mkdir/data/logs/zabbix-p

Copy the front-end files to the project directory:
[Email protected] zabbix-3.0. 3] # CP-RP frontends/php/*  /data/web/zabbix.lifec.com/

To edit an Nginx virtual host:
[[email protected] conf]# mkdir extra[[email protected] conf]# CD extra/[email protected] extra]# vim Zabbix.confserver {Listen8027; server_name Zabbix.lifec.com;access_log/data/logs/zabbix/zabbix.lifec.com.access.log main;index index.html index.php index.html;root/data/web/zabbix.lifec.com;location/{try_files $uri $uri//index.php?$args;} Location~ ^ (. +.php) (. *) $ {fastcgi_split_path_info^ (. +.php) (. *)$;       Include fastcgi.conf; Fastcgi_pass127.0.0.1:9000;       Fastcgi_index index.php; Fastcgi_param path_info $fastcgi _path_info;}}

To edit the nginx.conf configuration file:
[email protected] conf]# cat Nginx.confuser nginx;worker_processes1; #error_log logs/error.log warning; #error_log logs/error.log notice; #error_log logs/error.log info;pid Logs/nginx.pid;events {worker_connections1024x768;}    HTTP {include mime.types; Default_type Application/octet-stream; Log_format Main'$remote _addr-$remote _user [$time _local] "$request"'                      '$status $body _bytes_sent "$http _referer"'                      '"$http _user_agent" "$http _x_forwarded_for "'; Access_log logs/Access.log Main;    Sendfile on;    #tcp_nopush on; #keepalive_timeout0; Keepalive_timeout $;    #gzip on; Include Extra/*. conf;}

Edit zabbix_server.conf File:
logfile=/tmp/zabbix_server.logpidfile=/tmp/zabbix_server.piddbhost=localhostdbname= zabbixdbuser=Zabbixdbpassword=zabbix

Six, start the service to start Nginx:
[Email protected] conf]#/usr/local/nginx/sbin/nginx

Start PHP:
[Email protected] conf]#/USR/LOCAL/PHP/SBIN/PHP-FPM

Start Zabbix Server:
[Email protected] conf]#/usr/local/zabbix-3.0. 3/sbin/zabbix_server

To add a/etc/hosts file:
192.168. 119.140 zabbix.lifec.com

To view the service port:
[Email protected] conf]# netstat-lntupactive Internet connections (only servers) Proto Recv-Q send-q Local address Foreign address State Pid/Program name TCP0      0 0.0.0.0: A                  0.0.0.0:* LISTEN1029/sshd TCP0      0 0.0.0.0:8027                0.0.0.0:* LISTEN3730/nginx TCP0      0 0.0.0.0:10051               0.0.0.0:* LISTEN3743/zabbix_server TCP0      0 127.0.0.1:9000              0.0.0.0:* LISTEN3736/php-FPM TCP0      0 0.0.0.0:3306                0.0.0.0:* LISTEN24922/mysqld TCP0      0::: A:::* LISTEN1029/sshd UDP0      0 0.0.0.0: the                  0.0.0.0:*880/dhclient

Vii. Web-side configuration Zabbix

Only pictures, almost no text, hahaha ...

You need to download the file and upload it to the specified server directory.

zabbix3.0 Installing the deployment documentation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.