Zabbix installation (nginx1.8, mysql5.6, php5.4, zabbix3.0)

Source: Internet
Author: User
Tags configuration php fpm install php ibm db2 install openssl mcrypt snmp egrep

1, compile and install the installation of Nginx before the dependency

Yum install openssl-devel OpenSSL yum install pcre pcre-devel zlib zlib-devel

2, Installation Pcre

[[email protected] src]# pwd/usr/local/src[[email protected] src]# tar xf pcre-8.30.tar.gz [[email protected] src]# CD PCR E-8.30[[email protected] pcre-8.30]#/configure [[email protected] pcre-8.30]# make && make install

3. Installing Nginx

[[email protected] nginx-1.8.1]# pwd/usr/local/src/nginx-1.8.1[[email protected]  nginx-1.8.1]# useradd -s /sbin/nologin nginx[[email protected] nginx-1.8.1]#   ./configure    --prefix=/usr/local/nginx    --sbin-path=/ usr/sbin/nginx    --conf-path=/etc/nginx/nginx.conf    -- error-log-path=/var/log/nginx/error.log    --http-log-path=/var/log/nginx/access.log     --pid-path=/var/run/nginx/nginx.pid     --lock-path=/var/lock/ nginx.lock    --user=nginx    --group=nginx    -- With-http_ssl_module    --with-http_flv_module    --with-http_stub_ status_module    --with-http_gzip_static_module    -- Http-client-body-temp-path=/var/tmp/nginx/client/    --http-proxy-temp-path=/var/tmp/nginx/proxy/    --http-fastcgi-temp-path=/ var/tmp/nginx/fcgi/    --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi     --http-scgi-temp-path=/var/tmp/nginx/scgi    --with-pcre
[[email protected] nginx-1.8.1]# make && make install


4. Configure Nginx Startup script

Ln-s/lib/libpcre.so.0.0.1/lib/libpcre.so.1//32bit System

Ln-s/lib64/libpcre.so.0.0.1/lib64/libpcre.so.1//64bit System

chmod +x/etc/init.d/nginx

Chkconfig--add Nginx

Chkconfig Nginx on


5. Compile and install mysql5.6

A. Installation dependency

Yum-y install make gcc-c++ cmake bison-devel ncurses-devel

B. Compile and install MySQL

[[email protected] src]# pwd/usr/local/src[[email  Protected] src]# tar xf mysql-5.6.30.tar.gz[[email protected] src]# cd  mysql-5.6.30[[email protected] mysql-5.6.30]# cmake  -dcmake_install_prefix=/ usr/local/mysql  -dmysql_datadir=/usr/local/mysql/data  -dsysconfdir=/etc  - Dwith_myisam_storage_engine=1  -dwith_innobase_storage_engine=1  -dwith_memory_storage_ engine=1  -dwith_readline=1  -dmysql_unix_addr=/var/lib/mysql/mysql.sock  - dmysql_tcp_port=3306  -denabled_local_infile=1  -dwith_partition_storage_engine=1   -dextra_charsets=all  -ddefault_charset=utf8  -ddefault_collation=utf8_general_ci 
[[email protected] mysql-5.6.30]# make && make install
Groupadd mysqluseradd-g MySQL mysqlchown-r mysql:mysql/usr/local/mysqlcp support-files/mysql.server/etc/init.d/ Mysqldchkconfig mysqld onscripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user =mysql

6, compile and install php5.4 (compile and install PHP, this environment really, always error, can only be missing what to fill what)

A, install the following package

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/83/FE/wKioL1eDLIzgVS9nAAAkwwl8GHk551.jpg "title=" Php.jpg "alt=" Wkiol1edlizgvs9naaakwwl8ghk551.jpg "/>

b, the installation steps are as follows

[Email protected] freetype-2.3.10]#/configure--prefix=/usr/local/freetype[[email protected] freetype-2.3.10]# Make && make install
[[email protected] gd-2.0.33]#/configure--prefix=/usr/local/gd[[email protected] gd-2.0.33]# make && make Install
[[email protected] jpeg-7]#/configure--prefix=/usr/local/jpeg-7[[email protected] jpeg-7]# make && make Install
[Email protected] libiconv-1.14]#/configure--prefix=/usr/local/libiconv[[email protected] libiconv-1.14]# make && make Install
[Email protected] libmcrypt-2.5.7]#/configure--prefix=/usr/local/libmcrypt[[email protected] libmcrypt-2.5.7]# Make && make Install[[email protected] libpng-1.2.41]#./configure--prefix=/usr/local/libpng[[email Protected ] libpng-1.2.41]# make && make installyum-y install bzip2-develyum-y install libxml2yum-y install Libxml2-devel Yum-y Install Curl-develyum install php-mcrypt libmcrypt libmcrypt-devel

C. Start compiling the installation php5.4

[Email protected] php-5.4.13]# Pwd/usr/local/src/php/php-5.4.13[[email protected] php-5.4.13]#./configure--prefix= /usr/local/php--with-mysql=/usr/local/mysql--with-openssl--enable-fpm--with-mysqli=/usr/local/mysql/bin/mysql_ Config--enable-mbstring--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr-- Enable-xml--enable-sockets--with-mcrypt--with-config-file-path=/etc--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D-- with-bz2--enable-maintainer-zts--with-curl--with-libmcrypt

D, set the PHP configuration file and startup script

[Email protected] etc]# pwd/usr/local/php/etc[[email protected] etc]# lltotal 52-rw-r--r--. 1 root root 1148 Apr 04:31 pear.conf-rw-r--r--. 1 root root 22794 June 8 php-fpm.conf
-rwxr-xr-x. 1 root root 2.3K June 8 Php-fpm[[email protected] init.d]# PWD/ETC/INIT.D

7, nginx Configuration PHP Association

#upstream php upstream PHP {server 127.0.0.1:9000 max_fails=0;         Server 127.0.0.1:9001 max_fails=0; }


8, configuration Zabbix need site Nginx virtual directory

[[Email protected] vhosts]# pwd/etc/nginx/vhosts[[email protected] vhosts]# cat  monitor.conf server {    listen        80;    server_name  10.0.20.88;    access_log    logs/zabbix_access.log  main;    error_log  logs/zabbix_ Error.log;    location / {        root    /var/www/zabbix;        index  index.php  index.html index.htm ;    }    location ~ \. php$ {        root   /var/www/zabbix;         fastcgi_pass   127.0.0.1:9000;         fastcgi_param  script_filename  $document _root$fastcgi_script_name ;         fastcgi_index  index.php;        include         fastcgi_params;    }}


9, the above required LNMP environment installed, then began to compile the installation Zabbix

[Email protected] zabbix-3.0.3]# Pwd/usr/local/src/zabbix-3.0.3[[email protected] zabbix-3.0.3]#./configure-- Prefix=/usr/local/zabbix--enable-server--enable-agent--enable-proxy--with-mysql=/usr/local/mysql/bin/mysql_ Config--with-net-snmp--with-libcurl--enable-java[[email protected] zabbix-3.0.3]# make && make install

The following errors are reported during the installation process

Configure:error:Invalid Net-snmp directory-unable to find Net-snmp-config

Solutions

Yum Install Net-snmp-devel-y


10. Copy the Web site code and import the Zabbix data table structure

[Email protected] frontends]# pwd/usr/local/src/zabbix-3.0.3/frontends[[email protected] frontends]# cp-rf php/*/var /www/zabbix/
mysql> use mysql;mysql> CREATE database Zabbix character Set utf8;mysql> use zabbix;mysql> source/usr/local/s Rc/zabbix-3.0.3/database/mysql/schema.sql;mysql> Source/usr/local/src/zabbix-3.0.3/database/mysql/data.sql; Mysql> Source/usr/local/src/zabbix-3.0.3/database/mysql/images.sql;

11. Modify the configuration file

[[email protected] conf]# egrep -v  "^$|^#"  /usr/local/zabbix/etc/zabbix_server.conflistenport=10051logfile=/tmp/zabbix_server.logdbhost= 127.0.0.1dbname=zabbixdbuser=rootdbsocket=/var/lib/mysql/mysql.socktimeout=4logslowqueries=3000 
[Email protected] conf]# egrep-v "^$|^#"/var/www/zabbix/conf/zabbix.conf.php<?php//Zabbix GUI configuration file. Global $DB; $DB [' TYPE '] = ' MYSQL '; $DB [' SERVER '] = ' 127.0.0.1 '; $DB [' PORT '] = ' 0 '; $DB [' DATABASE '] = ' Zabbix '; $DB [' U SER '] = ' root '; $DB [' PASSWORD '] = ';//Schema name. Used for IBM DB2 and PostgreSQL. $DB [' SCHEMA '] = '; $ZBX _server = ' 192.168.100.123 '; $ZBX _server_port = ' 10051 '; $ZBX _se Rver_name = ' Baofoo '; $IMAGE _format_default = Image_format_png;


Zabbix installation (nginx1.8, mysql5.6, php5.4, zabbix3.0)

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.