ZABBIX-LNMP Installation

Source: Internet
Author: User

For example:

MySQL installation directory/usr/local/mysq as MySQL

PHP installation directory/usr/local/php as PHP

Nginx installation directory/usr/local/nginx as Nginx

1. Install PHP

Yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel-y

wget Http://php.net/get/php-5.4.42.tar.gz/from/a/mirror

TAR-XZVF php-5.5.24.gz

CD php-5.5.24

./configure--prefix=/php--with-config-file-path=/php/etc--with-bz2--with-curl--enable-sockets--disable-ipv6-- WITH-GD--with-jpeg-dir=/phpphppic--with-png-dir=/php/phppic--with-freetype-dir=/php/phppic-- Enable-gd-native-ttf--with-iconv-dir=/php/phppic--enable-mbstring--enable-calendar--with-gettext-- With-libxml-dir=/php/phppic--with-zlib--with-pdo-mysql=/mysql/bin/mysql_config--with-mysqli=/mysql/bin/mysql_ Config--with-mysql=/mysql/--enable-bcmath--enable-dom--enable-xml--enable-fpm

Cp/php/etc/php-fpm.conf.default/php/etc/php-fpm.conf

CP Php-5.5.24/php.ini-development/php/lib/php.ini

Edit PHP.ini

Max_execution_time = 300

Memory_limit = 128M

Post_max_size = 16M

upload_max_filesize = 2M  

Max_input_time = 300

Date.timezone PRC

2. mysql Installation

wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.20-linux-glibc2.5-i686.tar.gz

#groupadd mysql

#useradd -g mysql mysql

Tar mysql.tar.gz-c/usr/local/mysql

chown -R mysql:mysql /usl/local/mysql

Initializing the database scripts/mysql_install_db  --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/dataCP Support-files/mysql.server/etc/init.d/mysql

Modifying a configuration file

123 [[email protected] mysql]# cp my.cnf /etc/my.cnf/usr/local/mysql[[email protected] mysql]# vi /etc/my.cnf
123456 [mysqld]中添加:basedir = /usr/local/mysqldatadir = /usr/local/mysql/dataport = 3306server_id = 1

Start the MySQL service

1 #ln -s /usr/local/mysql/bin/mysql /usr/bin

 

1 #service mysqld start

Log in to MySQL and delete empty users

123456789101112131415161718 mysql> SELECTuser,host,passwordFROMmysql.user;+------+-----------+----------+user| host      | password|+------+-----------+----------+| root | localhost |          || root | 10-4-5-9  |          || root | 127.0.0.1 |          || root | ::1       |          ||      | localhost |          ||      | 10-4-5-9  |          |+------+-----------+----------+rowsinset(0.00 sec)mysql> UPDATEmysql.user setpasswordPASSWORD(‘gechong‘WHEREuser‘root‘;mysql> DROPUSER‘‘@localhost;mysql> FLUSH PRIVILEGES;

3, Installation Niginx

TAR-XZVF nginx-1.7.11.tar.gz

TAR-XZVF pcre-8.35.tar.gz

TAR-XZVF zlib-1.2.8.tar.gz

TAR-XZVF openssl-1.0.2a.tar.gz

TAR-XZVF openssl-1.0.2a.tar.gz

Yum Install gcc Mhash zlib-devel

CD zlib-1.2.8
./configure && make && make install

Cd.. /openssl-1.0.2a
./config && make && make install

Yum install-y gcc gcc-c++

Cd.. /pcre-8.35
./configure && make && make install


Groupadd Nginx

Useradd-g Nginx Nginx

Cd.. /nginx.nginx-1.7.11


./configure--prefix=/usr/local/nginx/--with-http_stub_status_module--with-http_ssl_module--with-http_gzip_ Static_module--with-openssl=. /OPENSSL-1.0.2A--with-zlib=. /zlib-1.2.8--with-pcre=. /pcre-8.35--user=nginx--group=nginx

Make && make install

Cd/usr/local/nginx/conf

CP nginx.conf Nginx.confback

Nginx Configuration = =

Location ~ \.php$ {
Root/usr/local/nginx/web;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param Script_filename/scripts$fastcgi_script_name;
# include Fastcgi_params;
Include fastcgi.conf;
}

4, Zabbix installation

Download required version http://www.zabbix.com/download.php

./configure--prefix=/mydatas/monitor/zabbix/monitor/--enable-server--enable-agent--with-mysql=/mysql/bin/mysql _config--with-net-snmp--with-libcurl--WITH-LIBXML2

Make

Make install

Configure Zabbix

Create user
For security reasons, Zabbix only runs with a normal user, and if your current user is called Ttlsa, then you run it and he runs with Ttlsa identity. But if you run Zabbix in the root environment, then Zabbix will actively use the Zabbix user to run it. But if your system does not have a user named Zabbix, you need to create a user, as follows:
# Groupadd Zabbix
# useradd-g Zabbix Zabbix

4.1 Initializing the database

Mysql-uroot-p rootpassmysql> CREATE DATABASE Zabbix default CharSet utf8;mysql> quit;mysql-uroot-pttlsapwd Zabbi X < Database/mysql/schema.sql

Mysql-uroot-pttlsapwd Zabbix < Database/mysql/images.sql
Mysql-uroot-ppttlsapwd Zabbix < Database/mysql/data.sql

4.2 Configuring Zabbix
Configure Zabbix_server configuration file, Zabbix source directory

vim/zabbix/etc/zabbix_server.confdbname=zabbixdbuser=rootdbpassword=rootpassdbport=3306


4.3 Starting Zabbix Server

#/usr/local/zabbix/sbin/zabbix_server

Default Port 10051

4.4 Client Installation configuration

4.41 downloading and installing the client
All versions: Http://www.zabbix.com/download.php, you can directly download the binaries that have already been compiled, or you can install them in the source code.

#./configure--prefix=/usr/local/zabbix/--enable-agent# make# make install

# vim/usr/local/zabbix/etc/zabbix_agentd.conf
Server=127.0.0.1serveractive=127.0.0.1hostname=zabbix Server
Where both server and serveractive specify the IP address of the Zabbixserver, the difference is that the former is passive and the latter is active. This means that the server configuration is used to allow 127.0.0.1 this IP to come to me to fetch the data. And Serveractive's 127.0.0.1 means that the client actively submits the data to him

4.42 Zabbix Client Startup

/usr/local/zabbix/sbin/zabbix_agentd

5,Zabbix management Site Configuration

CP-RP zabbix/php/*/nginx/html #复制zabbix the php file in the source code to the Nginx site file;

Start Nginx Server

6. Browse web_ip/in IE

7, according to the prompt installation, Zabbix

When the last step encounters a prompt zabbix.conf.php invalid;

Click "Save configuation File" to zabbix.conf.php the downloaded files and copy them to the server directory/nginx/conf/zabbix.conf.php

Then click on "Retry" and there will be no fail.

Click "Finish" to complete the installation

8. Login to default admin Pass:zabbix

ZABBIX-LNMP Installation

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.