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是一个企业级的.开源的.分布式的 ...
随机推荐
- 1066: 输入n个数和输出调整后的n个数
1066: 输入n个数和输出调整后的n个数 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 2739 Solved: 1578[Submit][Stat ...
- overloading and overriding
What is the difference between method overloading and method overriding in Java? Differences between ...
- stm32F042 (二) 按键触发中断
已经实现GPIO口输出高低电平控制LED,这里实现按键触发中断来改变LED闪亮的频率,因为PB3连着LED,所以PB3的输出模式没有改变,随意选一个GPIO口PA7接按键产生中断.因为nucleo开发 ...
- NOIP模拟赛 魔方
[题目描述] ccy(ndsf)觉得手动复原魔方太慢了,所以他要借助计算机. ccy(ndsf)家的魔方都是3*3*3的三阶魔方,大家应该都见过. (3的“顺时针”改为“逆时针”,即3 4以图为准.) ...
- python--以1-31的数字作为结尾的列表?论英文好的重要性!
一.python基础教程第2板(修订版)[代码清单2-1]中有一段要求打印‘以1-31的数字作为结尾的列表’ 截取代码示例:endings =['st','nd','rd'] +17*['th'] + ...
- NodeJS基础入门-Event
大多数Node.js核心API都采用惯用的异步事件驱动架构,其中某些类型的对象(触发器)会周期性地触发命名事件来调用函数对象(监听器). 例如,net.Server对象会在每次有新连接时触发事件;fs ...
- PHP 日常开发过程中的bug集合(持续更新中。。。)
PHP 日常开发过程中的bug集合(持续更新中...) 在日常php开发过程中,会遇到一些意想不到的bug,所以想着把这些bug记录下来,以免再犯! 1.字符串 '0.00'.'0.0'.'0' 是 ...
- python爬虫基础11-selenium大全5/8-动作链
Selenium笔记(5)动作链 本文集链接:https://www.jianshu.com/nb/25338984 简介 一般来说我们与页面的交互可以使用Webelement的方法来进行点击等操作. ...
- python 中 * 与**的使用
1.参数中使用如果是函数定义中参数前的*表示的是将调用时的多个参数放入元组中,**则表示将调用函数时的关键字参数放入一个字典中 如定义以下函数 def func(*args): print(args) ...
- LeetCode(215) Kth Largest Element in an Array
题目 Find the kth largest element in an unsorted array. Note that it is the kth largest element in the ...