1.背景介绍:

nginx:1.9.3     安装路径/data/nginx
php:5.5.27     安装路径 /data/php
mysql:5.6.28      安装路径/usr/local/mysql
zabbix server:3.2.8   安装路径 /data/zabbix
软件下载目录 /usr/local/src

2.nginx安装

# yum install pcre*
# yum install openssl*
# yum install openssl-devel

# cd /usr/local/src
# wget http://nginx.org/download/nginx-1.9.3.tar.gz
# tar -zxvf nginx-1.9.3.tar.gz
# cd nginx-1.9.3

# ./configure --prefix=/data/nginx \
--with-http_ssl_module --with-http_spdy_module \
--with-http_stub_status_module \
--with-pcre

# make && make install
# ln –s /data/nginx /usr/local/nginx
# mkdir /data/nginx/sites-enabled
# cd /data/nginx/conf
# vi nginx.conf

#在http{}内,server前添加以下内容

include /usr/local/nginx/sites-enabled/*.conf;

# vi /data/nginx/conf/fcgi.conf

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx; fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS ;

# cd /data/nginx/sites-enabled
# vi test.zabbix.com.conf

#for test.zabbix.com
log_format zabbix '$http_x_real_ip - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for' '"$request_time"';
access_log /usr/local/nginx/logs/access_zabbix.log zabbix;
server
{
listen ;
server_name test.zabbix.com;
if ($http_user_agent ~* "(Googlebot|Baiduspider|Sosospider)" ) {
return ;
}
root /usr/local/zabbix/frontends;
index index.php;
location ~ "\.(js|ico|gif|jpg|png|css)$" {
expires 1w;
}
location / {
fastcgi_ignore_client_abort on;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
include fcgi.conf;
index index.php;
if (!-e $request_filename) {
rewrite . /index.php last;
break;
}
}
}

# /data/nginx/sbin/nginx -t
# /data/nginx/sbin/nginx
# /data/nginx/sbin/nginx -s reload

# vi /etc/rc.local
# /data/nginx/sbin/nginx

3.php安装

# yum install gcc make gd-devel libjpeg-turbo-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel –y
# cd /etc/yum.repos.d/
# wget http://www.atomicorp.com/installers/atomic
# bash atomic
# yum install php-mcrypt -y
# yum install libmcrypt -y
# yum install libmcrypt-devel -y

# ./configure --prefix=/data/php \
--enable-fpm \
--with-fpm-user=daemon \
--with-fpm-group=daemon \
--with-config-file-path=/usr/local/php/etc \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-gd \
--with-zlib \
--with-libxml-dir \
--with-curl \
--with-mhash \
--with-xmlrpc \
--with-mcrypt \
--with-openssl \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-gd-native-ttf \
--enable-ftp \
--enable-pcntl \
--enable-sockets \
--enable-zip \
--enable-soap \
--disable-debug \
--disable-ipv6 \
--with-gettext \
--enable-calendar \
--enable-dom

# make && make install
# ln –s /data/php /usr/local/php

# vi /etc/profile

export PHP_HOME=/usr/local/php
export PATH=$PATH:$PHP_HOME/bin

# source /etc/profile
# cd /usr/local/src/php-5.5.27
# cp -rf sapi/fpm/php-fpm.conf /usr/local/php/etc/
# cp -rf sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
# cp -rf php.ini-production /usr/local/php/etc/php.ini

# echo "/etc/init.d/php-fpm start">>/etc/rc.local
# cd /usr/local/php/etc

# echo ";error_log = /usr/local/php/var/log/php-fpm.log
;log_level = notice
;emergency_restart_threshold =
;emergency_restart_interval = 1m
;process_control_timeout =
;daemonize = yes
;listen.owner = daemon
;listen.group = daemon
;listen.mode =
;pm = dynamic
;pm.max_children =
;pm.min_spare_servers =
;pm.max_spare_servers =
;pm.max_requests = (*)
;request_terminate_timeout = 600s(*)
;request_slowlog_timeout = 300s
;rlimit_files =
;rlimit_core = ">> php-fpm.conf

# vi php.ini

max_execution_time =
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_input_time =
date.timezone = PRC

# /etc/rc.d/init.d/php-fpm start

4.安装mysql(此步骤略去)

5.zabbix安装

zabbix 官网:https://www.zabbix.com/download
# cd /usr/local/src
# tar -zxvf zabbix-3.2.8.tar.gz
# cd zabbix-3.2.8

# ./configure --prefix=/data/zabbix/ \
--enable-server \ //开启server端,做zabbix server的机器编译时必须加入
--enable-agent \ //开启agent端,被监控的机器编译时必须加入,server端也应加入
--enable-proxy \ //开启proxy端,打算使用zabbix proxy功能的机器编译时必须加入
--with-mysql=/usr/local/mysql/bin/mysql_config \ //整合mysql。编译时报找不到mysql_config时,应当加入源码安装路径中的绝对路径
--with-net-snmp \ //整合邮件发送模块。编译时报找不到net-snmp-config时,应当加入绝对路径
--with-libcurl \ //整合curl模块
--with-libxml2 //整合libxml2模块

# make && make install

# yum install fping -y
# cd /usr/local/src/zabbix-3.2.8/database/mysql

mysql>create database zabbix default charset utf8;
mysql -uroot -p zabbix<schema.sql
mysql -uroot -p zabbix<images.sql
mysql -uroot -p zabbix<data.sql
mysql>grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

# cp /usr/local/src/zabbix-3.2.8/conf/zabbix_server.conf /data/zabbix/etc/
# mkdir -p /data/zabbix/log
# vim /data/zabbix/etc/zabbix_server.conf

ListenPort=
LogFile= /data/zabbix/log/zabbix_server.log
LogFileSize=
DebugLevel=
PidFile= /data/zabbix/zabbix_server.pid
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/tmp/mysql.sock
DBPort=
StartPollers=
StartPollersUnreachable=
StartTrappers=
StartPingers=
ListenIP=0.0.0.0
HousekeepingFrequency=
CacheSize=1024M
StartDBSyncers=
HistoryCacheSize=1024M
TrendCacheSize=512M
ValueCacheSize=32M
Timeout=
AlertScriptsPath= /data/zabbix/share/alertscripts
ExternalScripts= /data/zabbix/share/externalscripts
LogSlowQueries=

# mkdir /data/zabbix/frontends
# cp -r /usr/local/src/zabbix-3.2.8/frontends/php/* /data/zabbix/frontends/
# chown -R zabbix.zabbix /data/zabbix
# chown -R daemon.daemon /usr/local/nginx/

# /data/zabbix/sbin/zabbix_server

6.重启加载

# /etc/init.d/php-fpm stop
# /etc/init.d/php-fpm start
# /usr/local/nginx/sbin/nginx -s reload

7.访问

http://172.16.59.98/

如何搭建zabbix server端的更多相关文章

  1. zabbix server端与agent端源码安装 自定义监控项

    ZabbixServer的安装(只有源码装zabbix才能装支持java) 搭建自定义yum仓库并安装支持包 yum -y install createrepo #下载依赖关系命令 createrep ...

  2. Zabbix(二) : Zabbix Server端配置文件说明

    Zabbix Server端配置文件说明 # This is a configuration file for Zabbix Server process # To get more informat ...

  3. Zabbix Server端配置文件说明

    zabbix作为运维邻域不可缺少的一员,它的各种文档可是数不胜数啊,但是关于配置文件的解释与说明就有点少.这里列出zabbix配置文件篇之zabbix_server. Zabbix Server端配置 ...

  4. zabbix server端自动发现和zabbix agent端自动注册

    一.zabbix自动发现 利用zabbix的discovery功能可以实现自动批量添加主机的功能. Zabbix自动发现实现自定义主机名: 通过自动发现添加的客户端主机的Host name 是以IP地 ...

  5. Zabbix Server端配置文件

    Zabbix Server端配置文件说明 # This is a configuration file for Zabbix Server process # To get more informat ...

  6. zabbix server 端安装

    1.系统环境 [root@crazy-acong ~]# cat /etc/redhat-release CentOS release 6.6 (Final) [root@crazy-acong ~] ...

  7. Centos 6.x 搭建 Zabbix Server

      zabbix(音同 zæbix)是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案. zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让 ...

  8. Android实战简易教程-第六十六枪(server端搭建和server端Json数据交互)

    学习Android有一段时间了.对server端有非常深的好奇,决定对server端的实现进行一些研究,这里实现了一个简单的小样例,用于获取server端的json数据,样例非常easy,适合刚開始学 ...

  9. linux搭建zabbix server

    一.linux配置jdk 1.安装rpm包,安装完成位置:/usr/java/jdk1.8.0_152 2.配置环境变量/etc/profile: JAVA_HOME=/usr/java/jdk1.. ...

随机推荐

  1. Sql server 编写99乘法表

    Sql 组织编写语句 declare @one int,@tow int,@str varchar(100),@num intselect @one=1while(@one<=9)beginse ...

  2. List接口、Set接口和Map接口

    1.List和Set接口继承自Collection接口,而Map不是继承的Collection接口 Map没有继承Collection接口,Map提供key到value的映射;一个Map中不能包含相同 ...

  3. Android 开发 HandlerThread详解 转载

    转载请注明出处:http://blog.csdn.net/vnanyesheshou/article/details/75073307 对于Handler不太懂的可以参考我的这两篇文章: Androi ...

  4. spring 之 property-placeholder 分析

    不难知道, property-placeholder 的解析是 PropertyPlaceholderBeanDefinitionParser 完成的, 但是 它仅仅是个parser , 它仅仅是读取 ...

  5. JAVA Aes加解密详解

    上篇随笔留了一个问题,两种加密结果不一样? 其实是内部实现方式不一样,具体见注释 /** * 提供密钥和向量进行加密 * * @param sSrc * @param key * @param iv ...

  6. 简单快捷使用Git

    1.简介和安装Git是世界上目前最先进的分布式版本控制系统.安装:https://git-for-windows.github.io下载.设置姓名和email:git config --global ...

  7. PHP获取手机型号

    <?php $user_agent = $_SERVER['HTTP_USER_AGENT'];     if (stripos($user_agent, "iPhone") ...

  8. python大法好——模块(内置模块未完)

    模块 模块是非常简单的Python文件,单个Python文件就是一个模块,两个文件就是两个模块. Python模块有什么作用? 1.模块内有许多函数方法,利用这些方法可以更简单的完成许多工作.2.模块 ...

  9. leetcode1028

    class Solution(object): def __init__(self): self.List = list() def rdfs(self,S): if S != '': length ...

  10. vue 全局组件【原】

    1.目录 2.内容 -Loading.vue <template> <div class="loading"> loading... </div> ...