1. 安装依赖

    yum install pcre*   #为了支持rewrite功能
    yum install openssl openssl-devel
    yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel -y #编译需要的依赖包
  2. 安装nginx

    wget http://nginx.org/download/nginx-1.12.2.tar.gz
    tar xvf nginx-1.12.2.tar.gz
    cd nginx-1.12.2 执行./configure --prefix=/usr/local/nginx-1.12.2 \
    --with-http_ssl_module --with-http_v2_module \
    --with-http_stub_status_module --with-pcre
    ####--with-http_spdy_module 1.9之后没有了,--with-http_v2_module取而代之
    make && make install
  3. 查看防火墙是否关闭(如果虚拟机可以访问nginx,物理机不能访问nginx)

    sudo systemctl status firewalld  查看防火墙状态
    sudo systemctl stop firewalld停止防火墙
    systemctl disable firewalld.service 禁止开机启用防火墙
    vim /etc/selinux/config 进入配置文件 设置:SELINUX=disabled(重启才生效)
    #或者防火墙开放80端口
    firewall-cmd --zone=public --add-port=80/tcp --permanent
  4. 安装mysql 5.7

    wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
    yum localinstall mysql57-community-release-el7-7.noarch.rpm
    yum repolist enabled | grep "mysql.*-community.*"
    yum install mysql-community-server
    service mysqld start
    grep 'temporary password' /var/log/mysqld.log #记录随机密码 oHr6jwY>Jeay
    mysql_secure_installation #初始化
    mysql -u root -p
  5. 新建以及初始化数据库zabbix

    create database zabbix;
    use zabbix;
    source /root/zabbix-3.4.3/database/mysql/schema.sql;
    source /root/zabbix-3.4.3/database/mysql/data.sql;
    source /root/zabbix-3.4.3/database/mysql/images.sql;
  6. 安装php 5.6 稳定版本

    yum -y groupinstall  "Development Tools"
    yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel -y 编译需要的依赖包
    wget http://php.net/get/php-5.6.28.tar.gz/from/this/mirror -O php-5.6.28.tar.gz
    cd php-5.6.28.tar.gz
    安装ldap,如果报错无法解决去掉-with-ldap编译
    yum -y install openldap openldap-devel
    cp -frp /usr/lib64/libldap* /usr/lib/
    ./configure -prefix=/usr/local/php -with-config-file-path=/usr/local/php/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 -with-ldap -enable-dom -enable-xml -enable-fpm -with-libdir=lib64 -enable-bcmath
    make
    make install
    #配置php
    #编辑php.ini-production
    #修改如下参数
    max_execution_time = 300
    memory_limit = 128M
    post_max_size = 16M
    upload_max_filesize = 2M
    max_input_time = 300
    date.timezone = PRC cp php.ini-production /usr/local/php/etc/php.ini
    cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
    #启动php-fpm,占用端口9000
    /usr/local/php/sbin/php-fpm
  7. 安装zabbix

    #下载zabbix
    wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.3/zabbix-3.4.3.tar.gz #解压
    tar xvf zabbix-3.4.3
    cd zabbix-3.4.3 #创建zabbix用户(使用root启动时,会自动找zabbix启动)
    centos:
    groupadd --system zabbix
    useradd --system -g zabbix -d /usr/lib/zabbix -s /sbin/nologin -c "Zabbix Monitoring System" zabbix
    ubuntu:
    addgroup --system --quiet zabbix
    adduser --quiet --system --disabled-login --ingroup zabbix --home /var/lib/zabbix --no-create-home zabbix #编译
    #找到mysql_config_editor的位置
    find / -name "mysql_config*"
    #安装
    yum install mysql-devel -y
    #如果编译遇到mysql文件冲突,则可能是版本冲突,使用rpm下载
    wget ftp://ftp.pbone.net/mirror/dev.mysql.com/pub/Downloads/MySQL-5.7/mysql-community-devel-5.7.25-1.el7.x86_64.rpm
    yum localinstall mysql-community-devel-5.7.25-1.el7.x86_64.rpm
    yum install net-snmp-devel -y yum install libevent-devel -y #配置zabbix server和agent ./configure --enable-server --enable-agent --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl --with-libxml2 make make install
  8. 配置server和agentd

    #启动脚本在
    /usr/local/sbin
    #配置文件在
    /usr/local/etc
    vim /usr/local/etc/zabbix_server.conf
    DBName=zabbix
    DBUser=root
    DBPassword=123456
    DBPort=3306 vim /usr/local/etc/zabbix_agentd.conf
    Server=127.0.0.1
    ServerActive=127.0.0.1
    Hostname=Zabbix server
  9. 配置nginx zabbix

    要保证前端文件非root用户有权限

    cp -r /root/zabbix-3.4.3/frontends/php/*   /data/zabbix-frontend
    sudo chmod -R 777 /data/zabbix-frontend # vim /usr/local/nginx-1.12.2/conf/nginx.conf
    server {
    listen 80;
    server_name localhost; #charset koi8-r; access_log /root/logs/zabbix.access.log main; #最上面的log_format注释要取消
    index index.html index.php index.html;
    root /data/zabbix-frontend;
    location / {
    try_files $uri $uri/ /index.php?$args;
    }
    location ~ ^(.+.php)(.*)$ {
    #root /data/zabbix-frontend;
    fastcgi_split_path_info ^(.+.php)(.*)$;
    include fastcgi.conf;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    #fastcgi_param PATH_INFO $fastcgi_path_info;
    #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #include fastcgi_params;
    }
    #error_page 404 /404.html; # redirect server error pages to the static page /50x.html
    #
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root html;
    }
  10. 如果安装之后,zabbix页面报错zabbix server is not running。需要查看/tmp/zabbix_server.log日志,然后再启动/usr/local/sbin/zabbix_server

官方安装:https://www.zabbix.com/download?zabbix=3.0&os_distribution=centos&os_version=7&db=mysql

zabbix基于LNMP安装的更多相关文章

  1. zabbix基于docker安装

    centos的版本 # cat /etc/redhat-release CentOS Linux release (Core) docker的安装 配置yum源 # vim /etc/yum.repo ...

  2. redis安装----非基于lnmp安装

    在 Ubuntu 系统安装 Redi 可以使用以下命令: $sudo apt-get update $sudo apt-get install redis-server 启动 Redis $ redi ...

  3. 基于LNMP的Zabbbix之Zabbix Agent源码详细安装,但不给图

    基于LNMP的Zabbbix之Zabbix Server源码详细安装:http://www.cnblogs.com/losbyday/p/5828547.html wget http://jaist. ...

  4. 基于LNMP的Zabbbix之Zabbix Server源码详细安装,但不给图

    Zabbix Server安装 看到那里有错或者有什么问题的话,求指点 邮箱:losbyday@163.com 上一篇PHP源码安装参见基于LNMP的Zabbbix之PHP源码安装:https://i ...

  5. 基于LNMP架构搭建wordpress博客之安装架构说明

    架构情况 架构情况:基于LNMP架构搭建wordpress系统 软件包版本说明: 系统要求 :  CentOS-6.9-x86_64-bin-DVD1.iso PHP版本  :  php-7.2.29 ...

  6. 基于Oracle安装Zabbix

    软件版本 Oracle Enterprise Linux 7.1 64bit Oracle Enterprise Edition 12.1.0.2 64bit Zabbix 3.2.1 准备工作 上传 ...

  7. 运用Zabbix实现内网服务器状态及局域网状况监控(3) —— Zabbix服务端安装

    1. Zabbix服务端安装,基于LNMP PHP5.5+Nginx1.9安装配置:http://www.cnblogs.com/vurtne-lu/p/7707536.html MySQL5.5编译 ...

  8. zabbix 基于JMX的Tomcat监控

    zabbix 基于JMX的Tomcat监控 一.环境 ubuntu14.04 LTS Java 1.7.0 zabbix 2.4.5 二.安装配置 1.安装JavaGateway 在ubuntu14. ...

  9. Zabbix概念、安装以及快速入门

    Zabbix is an enterprise-class open source distributed monitoring solution.[1] Zabbix是一个企业级的.开源的.分布式的 ...

随机推荐

  1. 使用FontDialog组件设置字体

    实现效果: 知识运用: FontDialog组件的Font属性 //获取或设置选定的字体 public Font Font  { get;set; } 实现代码: private void butto ...

  2. 如何使用动画库animate.css

    animate.css是一个CSS3动画库,里面预设了抖动(shake).闪烁(flash).弹跳(bounce).翻转(flip).旋转(rotateIn/rotateOut).淡入淡出(fadeI ...

  3. idea中pom.xml没有工作 IDEA中maven项目pom.xml依赖不生效解决

    问题: 今天在web项目中需要引入poi相关jar包.查看之下才发现pom.xml中的依赖虽然已经下载到了本地仓库 repository,但是却没有加入到项目路径的 Extenal Libraries ...

  4. checkbox点击选中,再点击取消,并显示在文本框中

    function checkItem(e,itemId) { var item = document.getElementById(itemId); var $items = $(item); if ...

  5. mysql grant 用户权限说明

    mysql grant 用户权限说明 Mysql 有多个个权限?经常记不住,今天总结一下,看后都能牢牢的记在心里啦!! 很明显总共28个权限:下面是具体的权限介绍:转载的,记录一下: 一.权限表 my ...

  6. Slasher Flick-freecodecamp算法题目

    Slasher Flick(截断数组) 要求 返回一个数组被截断n个元素后还剩余的元素,截断从索引0开始. 思路 利用.splice(0,howMany)删除数组中索引从0开始的howMany个元素 ...

  7. leetcode-16-greedyAlgorithm

    455. Assign Cookies 解题思路: 先将两个数组按升序排序,然后从后往前遍历,当s[j] >= g[i]的时候,就把s[j]分给g[i],i,j都向前移动,count+1;否则向 ...

  8. scanf(),gets(),getchar()

    scanf()与gets()区别: scanf( )函数和gets( )函数都可用于输入字符串,但在功能上有区别.若想从键盘上输入字符串"hi hello",则应该使用gets() ...

  9. (转)减少oracle sql回表次数 提高SQL查询性能

    要写出高效的SQL,那么必须必须得清楚SQL执行路径,介绍如何提高SQL性能的文章很多,这里不再赘述,本人来谈谈如何从 减少SQL回表次数 来提高查询性能,因为回表将导致扫描更多的数据块. 我们大家都 ...

  10. Linux学习-核心与核心模块

    谈完了整个开机的流程,您应该会知道,在整个开机的过程当中,是否能够成功的驱动我们主机的硬 件配备, 是核心 (kernel) 的工作!而核心一般都是压缩文件,因此在使用核心之前,就得要将他解 压缩后, ...