Zabbix学习笔记(二)

1、环境介绍

操作系统:Centos7.3 Linux

版本:nginx-1.14.2

镜像源:阿里镜像源

2、安装依赖包

yum install -y wget gcc gcc-c++ make pcre pcre-devel zlib zlib-devel openssl openssl-devel

3、安装nginx

版本:nginx-1.14.2

tar zxf nginx-1.14.2.tar.gz

cd nginx-1.14.2

./configure –prefix=/usr/local/nginx

make

make install

4、启动

修改环境变量:

Vi  /etc/profile

PATH=$PATH:/usr/local/nginx/sbin/

 

nginx –t #检查nginx配置

nginx #启动

ss –lntup#进程检查

nginx -s stop #关闭nginx

《Zabbix学习笔记(二)》 

5、配置文件的位置

Nginx配置文件:conf/nginx.conf

Nginx日志文件:

Nginx的文件目录:

/usr/local/nginx/sbinconflogshtml

6、nginx处理php程序

vi /usr/local/nginx/conf/nginx.conf

1

        location / {

            root   html;

            index  index.html index.htm;

        }

修改为:

        location / {

            root   html;

            index  index.html index.htm index.php;

        }

2

        #location ~ \.php$ {

        #    root           html;

        #    fastcgi_pass   127.0.0.1:9000;

        #    fastcgi_index  index.php;

        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;

        #    include        fastcgi_params;

        #}

修改为:

        location ~ \.php$ {

            root           html;

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  $document_root$ fastcgi_script_name;

            include        fastcgi_params;

        }

7、测试

《Zabbix学习笔记(二)》 

    原文作者:知行知行
    原文地址: https://blog.51cto.com/6300167/2492017
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞