zoukankan      html  css  js  c++  java
  • Nginx编译安装

    # 准备安装环境

    yum groupinstall '开发工具' -y
    yum groupinstall '服务器平台开发' -y
    yum install pcre-devel -y # 这个是Nginx需要,用于基于perl的正则表达式扩展

    # 解包

    tar -xf nginx-1.14.0.tar.gz
    cd nginx-1.14.0

    # 添加用户和组

    groupadd -r nginx
    useradd -g nginx -r nginx

    # 配置 注意:其中 --conf-path=/etc/nginx/nginx.conf 可以不指定,不指定的话就在/usr/local/nginx目录下,这样的话方便卸载和迁移,做的标准点就放到/etc目录下

    ./configure --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --user=nginx --group=nginx --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx/nginx.lock --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_flv_module --with-http_mp4_module --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi

    # 编译安装

    make && make install

    # 准备目录

    mkdir -pv /var/tmp/nginx/{client,proxy,fastcgi,uwsgi}

    # 启动Nginx

    /usr/local/nginx/sbin/nginx

    # 查看监听

    ss -tnlp |grep --color nginx

    # 查看进程

    ps aux|grep --color nginx
    root       4819  0.0  0.1  46888  1196 ?        Ss   19:02   0:00 nginx: master process /usr/local/nginx/sbin/nginx  # 一个主进程
    nginx      4820  0.0  0.1  47320  1780 ?        S    19:02   0:00 nginx: worker process  # 一个work进程

    # 访问查看效果

    到这里Nginx编译安装就完成了。

  • 相关阅读:
    【刷题】BZOJ 1061 [Noi2008]志愿者招募
    【比赛】NOIP2017 列队
    react_app 项目开发 (6)_后台服务器端-node
    react_app 项目开发 (5)_前后端分离_后台管理系统_开始
    react_app 项目开发 (3)_单页面设计_react-router4
    react_app 项目开发 (2)_axios_pubsub-js
    react_app 项目开发
    React_基本原理_ajax
    React_生命周期
    组件化
  • 原文地址:https://www.cnblogs.com/xiaofengchu/p/9835598.html
Copyright © 2011-2022 走看看