Bootstrap

zabbix监控nginx状态

配置zabbix监控nginx状态。

首先搭建一套LNMP环境,部署discuz论坛用于后面监控案例。
搭建一个测试用论坛**

一、搭建Discuz论坛

1、配置epel源

[root@node4 ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

2、安装centos-release-scl源

[root@node4 ~]# yum install centos-release-scl -y

3、部署lnmp环境

[root@node4 ~]# yum -y install nginx mariadb-server rh-php72-php rh-php72-phpcli rh-php72-php-common \
rh-php72-php-fpm rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-pdo \
rh-php72-php-xml rh-php72-php-mysqlnd rh-redis5 sclo-php72-php-pecl-redis5

4、配置php-fpm

[root@node4 ~]# vim /etc/opt/rh/rh-php72/php-fpm.d/www.conf
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
; RPM: apache user chosen to provide access to the same directories as httpd

;user = apache
user = nginx

; RPM: Keep a group allowed to write in log dir.

;group = apache
group = nginx

5、准备论坛代码

[root@node4 ~]# mkdir /code/discuz -p

论坛代码可到官网下载:https://www.discuz.net/forum-10-1.html
上传下载的Discuz_X3.3_SC_UTF8.zip
[root@node4 ~]# rz -E
rz waiting to receive.
[root@node4 ~]# ls
anaconda-ks.cfg  Discuz_X3.3_SC_UTF8.zip

解压到创建的指定目录下
[root@node4 ~]# unzip -q Discuz_X3.3_SC_UTF8.zip -d /code/discuz/
[root@node4 ~]# cd /code/discuz
[root@node4 discuz]# ll
total 4
drwxr-xr-x  2 root root  102 Jul 27  2017 readme
drwxr-xr-x 12 root root 4096 Jul 27  2017 upload
drwxr-xr-x  4 root root   72 Jul 27  2017 utility

修改所属组
[root@node4 discuz]# chown -R nginx:nginx /code/discuz/

6、配置论坛首页

;