zoukankan      html  css  js  c++  java
  • Linux九阴真经之大伏魔拳残卷5 nginx

    编译安装 nginx 

    [root@localhost ~]# yum install pcre-devel openssl-devel zlib-devel -y     #安装前提控件
    [root@localhost ~]# useradd -r -s /sbin/nologin nginx                      #创建 nginx用户 并设置为不可登录
    [root@localhost ~]# http://nginx.org/download/nginx-1.12.2.tar.gz          #官网下载新版nginx安装包
    [root@localhost ~]# tar -xvf nginx-1.12.2.tar.gz
    [root@localhost ~]# cd nginx-1.12.2                                        #解压后进入nginx文件夹

    开始编译安装

    [root@localhost ~]# ./configure --prefix=/app/nginx    #在根下创建一个app目录用来存放 nginx
    > --conf-path=/etc/nginx/nginx.conf
    > --error-log-path=/var/log/nginx/error.log
    > --http-log-path=/var/log/nginx/access.log
    > --pid-path=/var/run/nginx.pid
    > --lock-path=/var/run/nginx.lock
    > --user=nginx --group=nginx
    > --with-http_ssl_module
    > --with-http_v2_module
    > --with-http_dav_module
    > --with-http_stub_status_module
    > --with-threads --with-file-aio

    假如你要修改一些配置 

    [root@localhost nginx-1.12.2]# vim src/http/ngx_http_header_filter_module.c

    [root@localhost nginx-1.12.2]# vim src/core/nginx.h

    [root@localhost nginx-1.12.2]# make -j 4 && make install
    [root@localhost app]# ls
    nginx
    [root@localhost app]# cd nginx/
    [root@localhost nginx]# ls
    html  sbin
    [root@localhost nginx]# cd sbin
    [root@localhost sbin]# ls
    nginx
    [root@localhost sbin]# ./nginx
    [root@localhost sbin]# ss -ntl
    State       Recv-Q Send-Q Local Address:Port               Peer Address:Port              
    LISTEN      0      128               *:80                            *:*                  
    LISTEN      0      128               *:22                            *:*                  
    LISTEN      0      100       127.0.0.1:25                            *:*                  
    LISTEN      0      128              :::22                           :::*                  
    LISTEN      0      100             ::1:25                           :::*    

    此时80端口已经打开 ,我们在浏览器上访问以下本机测试一下

    成功
  • 相关阅读:
    POJ1251 Jungle Roads 【最小生成树Prim】
    聪明的kk
    日积月累:weightSum和layout_weight属性合用
    ubuntu 下舒畅的使用libreoffice
    maple 教程
    龙、虎、鲸书杂谈
    百度没出新算法之前这样的最好的的优化方案
    DWR入门实例(二)
    Android应用公布的准备——生成渠道包
    leetcode第一刷_Spiral Matrix II
  • 原文地址:https://www.cnblogs.com/huxiaojun/p/9289452.html
Copyright © 2011-2022 走看看