没有合适的资源?快使用搜索试试~ 我知道了~
Centos7.9安装zabbix6.0LTS版
需积分: 13 25 下载量 145 浏览量
2023-02-25
20:56:34
上传
评论 3
收藏 257KB DOCX 举报
温馨提示
试读
21页
Centos7.9安装zabbix6.0LTS版
资源推荐
资源详情
资源评论
这里使用为 CentOS 7.9 版本进行测试验证,zabbix Server 采用源码包部署,数据库采用 MySQL8.0 版本,
zabbix-web 使用 ,nginx+php 来实现。具体信息如下:
软件名 版本 安装方式
Zabbix Server 6.0.12 源码安装
Zabbix Agent 6.0.12 源码安装
MySQL 8.0.28 yum 安装
Nginx 1.20.1 yum 安装
Php 7.4.30 源码安装
1,安装 nginx
# 关闭 selinux
$ sed -i 's/enforcing/disabled/' /etc/selinux/config #永久
$ setenforce 0 # 临时
# 创建 nginx 用户和用户组:
$ groupadd -f nginx
$ useradd -g nginx nginx
# 配置好系统 yum 源,安装如下依赖包:
$ yum install gcc pcre-devel openssl-devel
# 下载上传 nginx-1.20.2.tar.gz 至服务器,解压文件包命令如下:
$ tar -xvf nginx-1.20.2.tar.gz
$ cd nginx-1.20.2
# 安装编译 nginx 命令如下:
./configure --prefix=/usr/local/nginx \
--conf-path=/usr/local/nginx/etc/nginx/nginx.conf \
--error-log-path=/usr/local/nginx/logs/error.log \
--http-log-path=/usr/local/nginx/logs/access.log \
--http-client-body-temp-path=/usr/local/nginx/tmp/nginx/client_body \
--http-proxy-temp-path=/usr/local/nginx/tmp/nginx/proxy \
--http-fastcgi-temp-path=/usr/local/nginx/tmp/nginx/fastcgi \
--pid-path=/usr/local/nginx/logs/nginx.pid \
--lock-path=/usr/local/nginx/lock/nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_gzip_static_module \
--with-pcre
$ make && make install
# 配置 nginx.conf,修改如下内容
**************************************************************************
#keepalive_timeout 0;
keepalive_timeout 65; ##在下一行添加
server_tokens off; ##隐藏版本号
location / {
root /usr/local/nginx/html/zabbix;
try_files $uri $uri/ /index.php?query_string;
index index.php index.html index.htm;
}
location ~ \.php$ {
root /usr/local/nginx/html/zabbix;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
**************************************************************************
# 隐藏 nginx 信息
vi /nginx/src/http/ngx_http_header_filter_module.c
static u_char ngx_http_server_string[] = "Server: linux" CRLF; ##将 NGINX 改为 Linux
static u_char ngx_http_server_full_string[] = "Server: " CRLF; ##去掉 NGINX_VER
static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF;
# 配置 nginx 开机自启动服务
# 1、创建/usr/lib/systemd/system/nginx.service 文件,输入如下内容:
$ vi /usr/lib/systemd/system/nginx.service
[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/etc/nginx/nginx.conf
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/etc/nginx/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
**************************************************************************
# 2、重载系统服务:
$ systemctl daemon-reload
# 3、设置开机启动:
$ mkdir -p /usr/local/nginx/tmp/nginx/client_body
systemctl enable nginx.service
systemctl start nginx.service
2,安装 php
# 下载安装如下依赖包
$ yum install libxml2-devel sqlite-devel libcurl-devel libpng-devel libjpeg-turbo-devel libXpm-devel freetype-devel
libicu-devel gcc-c++ libxslt-devel oniguruma-devel libsodium-devel openldap-devel net-snmp-devel libwebp-devel
# 如果 yum 源没有 oniguruma oniguruma-devel libsodium libsodium-devel libwebp-devel 安装包,则需要从网
上下载安装。
$ rpm -ivh oniguruma-6.7.0-1.el7.x86_64.rpm oniguruma-devel-6.7.0-1.el7.x86_64.rpm
$ rpm -ivh libsodium-1.0.18-2.el7.x86_64.rpm libsodium-devel-1.0.18-2.el7.x86_64.rpm
$ rpm -ivh libwebp-0.3.0-10.el7_9.x86_64.rpm rpm -ivh libwebp-devel-0.3.0-10.el7_9.x86_64.rpm
$ cp -frp /usr/lib64/libldap* /usr/lib/
# centos7.9 系统自带 libzip-0.10.1-8 版本太低,PHP 不支持,所以源码安装 libzip-1.2.0
$ tar zxf libzip-1.2.0.tar.g
$ cd libzip-1.2.0
$ ./configure
$ make && make install
$ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"
# 源码安装 php,需要在 root 环境下编译,否则会提示 libzip 错误
$ tar -xvf php-7.4.30.tar.gz
./configure --prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-config-file-scan-dir=/usr/local/php/conf.d \
--enable-fpm \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir=/usr/local/php \
--with-freetype \
--with-jpeg \
--with-zlib \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--enable-intl \
--enable-ftp \
--enable-gd \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--with-zip \
--enable-soap \
--with-gettext \
--enable-opcache \
--with-xsl \
--with-webp \
--with-xpm \
--with-snmp \
--with-ldap
$ vim Makefile # 开头是‘EXTRA_LIBS’,结尾加上‘-llber’
$ make && make install
# 配置 php-fpm
$ cp /usr/local/php-7.4.30/php.ini-production /usr/local/php/etc/php.ini
# 修改 php.ini 文件,将对应参数做如下修改。
$ vi /usr/local/php/etc/php.ini
max_execution_time = 300
max_input_time = 300
post_max_size = 16M
date.timezone =Asia/Shanghai
剩余20页未读,继续阅读
资源评论
淡定╮
- 粉丝: 23
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 3122080306 邹子轩 实验报告二.docx
- 基于STM32 NUCLEO板设计彩色LED照明灯(纯cubeMX开发)(大赛作品,文档完整,可直接运行)
- 发那科工业机器人保养大全
- Sphere.h
- REMD固有时间尺度分解信号分量可视化(Matlab完整源码和数据)
- 嵌入式系统双单片机STC89C52+STC15W104多功能学习板电路图可扩展 适用于单片机初学者和教学
- 基于STM32蓝牙控制小车系统设计(硬件+源代码+论文)大赛作品
- XILINXFPGA源码基于Spartan3火龙刀系列FPGA开发板VGA测试例程
- Java聊天室的设计与实现【尚学堂·百战程序员】
- python中matplotlib教程
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功