Installation of Zabbix and LNMP platforms

Source: Internet
Author: User
Tags install openssl

Zabbix3.0.3 Installation Documentation

Environment Rhel 5.8

ip:192.168.0.8

Need to install:

Nginx

Php

Mysql

Zabbix

Installation steps:

One. Nginx1.6 Installation

Install Pcre (support regular expression) before installing Nginx, preferably also install OpenSSL (Can support security protocol site)

[Email protected] tmp]# tar zxvf pcre-8.35.tar.gz

[Email protected] pcre-8.35]#./configure

[[email protected] pcre-8.35]# make && make install

[Email protected] tmp]# tar zxvf openssl-1.0.1l.tar.gz

[Email protected] openssl-1.0.1l]#./config

[[email protected] openssl-1.0.1l]# make && make install

[Email protected] tmp]# TAR-ZXVF nginx-1.6.2.tar.gz

[Email protected] nginx-1.6.2]# Mkdir/usr/local/nginx

[Email protected] nginx-1.6.2]#/configure--prefix=/usr/local/nginx

[[email protected] nginx-1.6.2]# make && make install

View version Information

[Email protected] sbin]#./nginx-v

./nginx:error while loading shared libraries:libpcre.so.1:cannot open Shared object file:no such file or directory

[Email protected] sbin]#

[Email protected] sbin]# ln-s/usr/local/lib/libpcre.so.1/lib64

[Email protected] sbin]#./nginx-v

Nginx version:nginx/1.6.2

[Email protected] sbin]#

Start Nginx

[Email protected] sbin]#/usr/local/nginx/sbin/nginx

[Email protected] sbin]# Ps-ef | grep nginx

Root 7772 1 0 15:08? 00:00:00 Nginx:master Process/usr/local/nginx/sbin/nginx

Nobody 7773 7772 0 15:08? 00:00:00 Nginx:worker Process

Root 7775 19121 0 15:08 pts/6 00:00:00 grep nginx

[Email protected] sbin]# Cat/usr/local/nginx/logs/nginx.pid

7772

[Email protected] sbin]#

Close Nginx

[[email protected] sbin]# kill 7772

Or kill '/usr/local/nginx/logs/nginx.pid '

Configuration of the Nginx configuration document:

[Email protected] conf]# vi/usr/local/nginx/conf/nginx.conf

Worker_processes 1;

Events {

Worker_connections 1024;

}

HTTP {

Include Mime.types;

Default_type Application/octet-stream;

Sendfile on;

Keepalive_timeout 65;

server {

Listen 80;

server_name localhost;

Location/{

root HTML;

Index index.php index.html index.htm;

}

Error_page 502 503 504/50x.html;

Location =/50x.html {

root HTML;

}

Location ~ \. (PHP|PHP5)? $ {

root/usr/local/nginx/html;

Fastcgi_pass 127.0.0.1:9000;

Fastcgi_index index.php;

# Fastcgi_param Script_filename/scripts$fastcgi_script_name;

Fastcgi_param Script_filename/usr/local/nginx/html$fastcgi_script_name;

Include Fastcgi_params;

}

}

}

Two. MySQL 5.6 Installation

[Email protected] tmp]# RPM-IVH mysql-server-5.6.21-1.rhel5.x86_64.rpm

[Email protected] tmp]# RPM-IVH mysql-client-5.6.21-1.rhel5.x86_64.rpm

To change the root user's password:

Mysqladmin-u root-p Password mysql123

Three. PHP 5.5.14 Installation

1. Installing dependent Packages

[email protected] sbin]# Yum install GCC bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel li Bxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel libjpeg-devel libiconv-devel Freetype-devel libpng-devel gd-devel curl-devel libxslt-devel

[Email protected] sbin]# TAR-XZVF libiconv-1.14.tar.gz

[Email protected] sbin]# CD libiconv-1.14

[Email protected] libiconv-1.14]#/configure--prefix=/usr/local/libiconv

[[email protected] libiconv-1.14]# make && make install

[Email protected] zabbixsoft]# TAR-XZVF libmcrypt-2.5.8.tar.gz

[Email protected] zabbixsoft]# CD libmcrypt-2.5.8

[Email protected] libmcrypt-2.5.8]#/configure--prefix=/usr/local/libmcrypt

[[email protected] libmcrypt-2.5.8] #make && make install

2. Create WWW user

[Email protected] sbin]# Groupadd www

[Email protected] sbin]# useradd-g www-s/sbin/nologin-m www

3. Install PHP

[Email protected] zabbixsoft]# TAR-XZVF php-5.5.14.tar.gz

CD php-5.5.14

./configure \

--prefix=/usr/local/php \

--WITH-CONFIG-FILE-PATH=/USR/LOCAL/PHP/ETC \

--enable-inline-optimization \

--disable-debug \

--disable-rpath \

--enable-shared \

--enable-opcache \

--ENABLE-FPM \

--WITH-FPM-USER=WWW \

--WITH-FPM-GROUP=WWW \

--WITH-MYSQL=MYSQLND \

--WITH-MYSQLI=MYSQLND \

--WITH-PDO-MYSQL=MYSQLND \

--with-gettext \

--enable-mbstring \

--with-iconv \

--with-mhash \

--WITH-OPENSSL \

--enable-bcmath \

--ENABLE-SOAP \

--with-libxml-dir \

--ENABLE-PCNTL \

--ENABLE-SHMOP \

--ENABLE-SYSVMSG \

--enable-sysvsem \

--ENABLE-SYSVSHM \

--enable-sockets \

--with-curl \

--with-zlib \

--enable-zip \

--WITH-BZ2 \

--with-readline \

--without-pear \

--disable-phar \

--WITH-GD \

--ENABLE-GD-NATIVE-TTF \

--with-png-dir \

--with-freetype-dir \

--with-jpeg-dir

[Email protected] php-5.5.14]# Make-j8

[[email protected] php-5.5.14]# make test

[[email protected] php-5.5.14]# make install

Configuring the PHP configuration file

[Email protected] php-5.5.14]# Cp/root/zabbixsoft/php-5.5.14/php.ini-development/usr/local/php/etc/php.ini

Configuring the PHP-FPM Service

[Email protected] etc]# cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf

[Email protected] php-5.5.14]# CP/ROOT/ZABBIXSOFT/PHP-5.5.14/SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM

[Email protected] php-5.5.14]# chmod +x/etc/init.d/php-fpm

Start PHP-FPM

[[Email protected] php-5.5.14]# service PHP-FPM start

Starting php-fpm Done

[Email protected] php-5.5.14]#

modifying related environment variables

[Email protected] bin]# VI ~/.bash_profile

Path=/usr/local/php/bin: $PATH

Look at the version:

[Email protected] bin]# php-v

Four Zabbix3.0.3 Installation

[Email protected] zabbix-3.0.3]# Groupadd Zabbix

[Email protected] zabbix-3.0.3]# useradd-g Zabbix Zabbix

[Email protected] lib]# ln-s/usr/local/lib/libiconv.so.2/usr/lib/libiconv.so.2

[Email protected] lib]#/sbin/ldconfig

[Email protected] zabbixsoft]# TAR-XZVF zabbix-3.0.3.tar.gz

[Email protected] zabbixsoft]# CD zabbix-3.0.3

./configure \

--enable-server \

--enable-agent \

--with-mysql \

--enable-ipv6 \

--WITH-NET-SNMP \

--with-libcurl \

--with-libxml2

[[email protected] zabbix-3.0.3]# make

[[email protected] zabbix-3.0.3]# make install

[Email protected] zabbix-3.0.3]# mysql-uroot-proot123

Mysql> CREATE database Zabbix character set UTF8 collate utf8_bin;

Mysql> Grant all privileges the zabbix.* to [e-mail protected] identified by ' Zabbix ';

mysql> flush Privileges;

[Email protected] zabbix-3.0.3]# Mysql-uzabbix-pzabbix Zabbix < Database/mysql/schema.sql

[Email protected] zabbix-3.0.3]# Mysql-uzabbix-pzabbix Zabbix < Database/mysql/images.sql

[Email protected] zabbix-3.0.3]# Mysql-uzabbix-pzabbix Zabbix < Database/mysql/data.sql

Configuring the Zabbix configuration file

Vi/usr/local/etc/zabbix_server.conf

Dbname=zabbix #数据库名称

Dbuser=zabbix #数据库用户名

Dbpassword=jiayuan.com #数据库密码

Listenip=localhost #数据库ip地址

Alertscriptspath=/usr/local/share/zabbix/alertscripts

Setting up the Zabbix startup service

[Email protected] core]# cp/root/zabbixsoft/zabbix-3.0.3/misc/init.d/fedora/core/zabbix_server/etc/rc.d/init.d/ Zabbix_server

[Email protected] core]# cp/root/zabbixsoft/zabbix-3.0.3/misc/init.d/fedora/core/zabbix_agentd/etc/rc.d/init.d/ Zabbix_agentd

[Email protected] sbin]# chkconfig zabbix_server on

[Email protected] sbin]# chkconfig zabbix_agentd on

To modify a PHP configuration file:

[Email protected] lib]# Vi/usr/local/php/etc/php.ini

Post_max_size 16M

Max_execution_time 300

Max_input_time 300

Date.timezone =asia/shanghai

Configure the Web site environment

[Email protected] frontends]# Cd/root/zabbixsoft/zabbix-3.0.3/frontends

[Email protected] frontends]# CP-RF Php/usr/local/nginx/html/zabbix

Start Zabbix

[Email protected] sbin]#/usr/local/sbin/zabbix_server

or service Zabbix_server start

Start Nginx

[Email protected] sbin]#/usr/local/nginx/sbin/nginx

Five. Interface Configuration installation Zabbix

Browser opens Http://192.168.0.8/zabbix

Start the Web Interface installation Zabbix

If you encounter the following floating red problem must be processed before you can continue

The above problem can be run phpize dynamic to install the appropriate PHP extension

[Email protected] gd]# pwd

/root/zabbixsoft/php-5.5.14/ext/gd

[Email protected] gd]#/usr/local/php/bin/phpize

Configuring for:

PHP Api version:20121113

Zend Module Api no:20121212

Zend Extension Api no:220121212

[Email protected] gd]#

[Email protected] gd]#/configure--with-php-config=/usr/local/php/bin/php-config--with-jpeg-dir-- With-freetype-dir

Follow the prompts,

    1. Click "Download the configuration file"
    2. Copy the downloaded files to/usr/local/nginx/html/zabbix/conf/zabbix.conf.php
    3. Assign permissions to it WX

[Email protected] conf]# chmod +wx/usr/local/nginx/html/zabbix/conf/zabbix.conf.php

The installation is complete

Reference Documentation:

Http://www.cnblogs.com/zangdalei/p/5712987.html

Http://wenku.baidu.com/link?url=0PxW49msf5yfiDeQZ8A2QiBDa12FrOFHSjI51bo-llJW6u1kFPR_ Iystq6focrjyamt2ggbivkxj53fzeisy-pz-adpccuqfscotlinjrws

Installation of Zabbix and LNMP platforms

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.