zabbix基于LNMP安装
安装依赖
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 #编译需要的依赖包安装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查看防火墙是否关闭(如果虚拟机可以访问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安装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新建以及初始化数据库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;安装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安装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.rpmyum 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
配置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配置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;
}- 如果安装之后,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安装的更多相关文章
- zabbix基于docker安装
centos的版本 # cat /etc/redhat-release CentOS Linux release (Core) docker的安装 配置yum源 # vim /etc/yum.repo ...
- redis安装----非基于lnmp安装
在 Ubuntu 系统安装 Redi 可以使用以下命令: $sudo apt-get update $sudo apt-get install redis-server 启动 Redis $ redi ...
- 基于LNMP的Zabbbix之Zabbix Agent源码详细安装,但不给图
基于LNMP的Zabbbix之Zabbix Server源码详细安装:http://www.cnblogs.com/losbyday/p/5828547.html wget http://jaist. ...
- 基于LNMP的Zabbbix之Zabbix Server源码详细安装,但不给图
Zabbix Server安装 看到那里有错或者有什么问题的话,求指点 邮箱:losbyday@163.com 上一篇PHP源码安装参见基于LNMP的Zabbbix之PHP源码安装:https://i ...
- 基于LNMP架构搭建wordpress博客之安装架构说明
架构情况 架构情况:基于LNMP架构搭建wordpress系统 软件包版本说明: 系统要求 : CentOS-6.9-x86_64-bin-DVD1.iso PHP版本 : php-7.2.29 ...
- 基于Oracle安装Zabbix
软件版本 Oracle Enterprise Linux 7.1 64bit Oracle Enterprise Edition 12.1.0.2 64bit Zabbix 3.2.1 准备工作 上传 ...
- 运用Zabbix实现内网服务器状态及局域网状况监控(3) —— Zabbix服务端安装
1. Zabbix服务端安装,基于LNMP PHP5.5+Nginx1.9安装配置:http://www.cnblogs.com/vurtne-lu/p/7707536.html MySQL5.5编译 ...
- zabbix 基于JMX的Tomcat监控
zabbix 基于JMX的Tomcat监控 一.环境 ubuntu14.04 LTS Java 1.7.0 zabbix 2.4.5 二.安装配置 1.安装JavaGateway 在ubuntu14. ...
- Zabbix概念、安装以及快速入门
Zabbix is an enterprise-class open source distributed monitoring solution.[1] Zabbix是一个企业级的.开源的.分布式的 ...
随机推荐
- java 第11次作业:你能看懂就说明你理解了——this关键字
this 代表当前对象
- vue 前端判断输入框不能输入0 空格。特殊符号。
oninput="value=value.replace(/[^\d.]/g,'').replace(/\.{2,}/g,'.').replace('.','$#$').replace(/\ ...
- C语言程序运行
vs2013编辑器 c程序的运行 一.启动Microsoft Visual C++ 2013版.新建项目 . 1. 文件——> 新建——> 项目. 2. 确定之后 弹出 ...
- Python json和simplejson的使用
在Python中,json数据和字符串的转换可以使用json模块或simplejson模块. json从Python2.6开始内置到了Python标准库中,我们不需要安装即可直接使用. simplej ...
- linux中vim永久显示行号、开启语法高亮
vim ~/.vimrc 进入insert模式,在最后加二行 syntax on set nu! 保存收工. 设置用视图模式的缩进为4个空格 set smartindent set tabstop=4 ...
- 下载linaro android 4.4.2 for panda4460
$ export MANIFEST_REPO=git://android.git.linaro.org/platform/manifest.git$ export MANIFEST_BRANCH=li ...
- .Net Task常见问题
最近尝试使用一下Task,但是使用过程中因为API的不熟悉碰到了很多问题,不清楚什么时间来调用Task.Start(),具体该怎么使用等等. 如下所描述的Task.Start()方法均为实例方法. 1 ...
- P3391 【模板】文艺平衡树FHQ treap
P3391 [模板]文艺平衡树(Splay) 题目背景 这是一道经典的Splay模板题——文艺平衡树. 题目描述 您需要写一种数据结构(可参考题目标题),来维护一个有序数列,其中需要提供以下操作:翻转 ...
- P2014 选课(树形背包)
P2014 选课 题目描述 在大学里每个学生,为了达到一定的学分,必须从很多课程里选择一些课程来学习,在课程里有些课程必须在某些课程之前学习,如高等数学总是在其它课程之前学习.现在有N门功课,每门课有 ...
- HDU 5402 模拟 构造 Travelling Salesman Problem
题意: 有一个n * m的数字矩阵,每个格子放着一个非负整数,从左上角走到右下角,每个格子最多走一次,问所经过的格子的最大权值之和是多少,并且输出一个路径. 分析: 如果n和m有一个是偶数的话,那么只 ...