zoukankan      html  css  js  c++  java
  • linux服务基础之编译安装nginx

    nginx源码下载地址: 

    http://nginx.org/download/nginx-1.16.0.tar.gz  //根据需要下载其他版本

    1. 下载nginx

    # wget http://nginx.org/download/nginx-1.16.0.tar.gz

    2. 安装nginx

    解决依赖关系:

    # yum install pcre-devel

    添加运行nginx的用户和组:

    # groupadd -r nginx
    # useradd -r -g nginx nginx

    编译安装nginx:

    # tar xf nginx-1.16.0.tar.gz 
    # cd nginx-1.16.0
    # ./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.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

    创建nginx编译安装时需要的目录:

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

    测试:

    # /usr/local/nginx/sbin/nginx  //运行nginx
    # ss -tnlp  //查看80端口是否被监听
    # ps aux | grep nginx
    root      37932  0.0  0.1  46896  1108 ?        Ss   18:49   0:00 nginx: master process /usr/local/nginx/sbin/nginx
    nginx     37933  0.0  0.1  47336  1704 ?        S    18:49   0:00 nginx: worker process 
    # elinks http://192.168.1.103  //可以看到nginx的欢迎页面

     

  • 相关阅读:
    echart自定义浮窗 增加点击事件
    原生js学习 选择dom
    GOjs版本2.0去除水印
    js 作用域
    javaScript的原型模式
    JavaScript的基本包装类型说明
    原生js 函数 callee属性
    Vue学习-基本指令
    js函数
    Kubernetes(一):云计算发展历程
  • 原文地址:https://www.cnblogs.com/ckh2014/p/10848623.html
Copyright © 2011-2022 走看看