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

    # 安装pcre库(Perl Compatible Regular Expressions;perl兼容正则表达式),为了使nginx支持具备URL重写功能的Rewrite模块。

    [root@kazihuo ~]# yum -y install pcre pcre-devel

    [root@kazihuo ~]# yum -y install openssl openssl-devel gcc

    [root@kazihuo ~]# rpm -qa pcre pcre-devel

    [root@kazihuo ~]# wget http://nginx.org/download/nginx-1.12.1.tar.gz

    [root@kazihuo ~]# tar axvf nginx-1.12.1.tar.gz

    [root@kazihuo ~]# useradd nginx -s /sbin/nologin -M

    [root@kazihuo ~]# cd nginx-1.12.1

    [root@kazihuo ~]# ./configure --help

    [root@kazihuo ~]# ./configure --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --prefix=/usr/local/nginx-1.12.1/

    [root@kazihuo ~]# ./configure --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-stream --with-stream_ssl_module --prefix=/usr/local/nginx-1.12.1/ 

    [root@kazihuo ~]# echo $?   # 根据返回值判断是否正常编译

    0

    [root@kazihuo ~]# make   # C语言编译的过程

    [root@kazihuo ~]# make install   #把编译的内容进行安装

    [root@kazihuo ~]# ln -sv /usr/local/nginx-1.12.1 /usr/local/nginx

    [root@kazihuo ~]# echo ‘export PATH=$PATH:/usr/local/nginx/sbin/’ > /etc/profile.d/nginx.sh

    [root@kazihuo ~]# source /etc/profile.d/nginx

    [root@kazihuo ~]# nginx -t

    [root@kazihuo ~]# nginx 

    [root@kazihuo ~]# curl -I 127.0.0.1

    HTTP/1.1 200 OK
    Server: nginx/1.12.1
    Date: Sun, 15 Jul 2018 03:47:36 GMT
    Content-Type: text/html
    Content-Length: 612
    Last-Modified: Sun, 15 Jul 2018 03:31:02 GMT
    Connection: keep-alive
    ETag: "5b4abff6-264"
    Accept-Ranges: bytes
  • 相关阅读:
    Java学习开篇
    《我的姐姐》
    世上本无事,庸人自扰之
    这48小时
    补觉
    淡定
    es java api 设置index mapping 报错 mapping source must be pairs of fieldnames and properties definition.
    java mongodb groupby分组查询
    linux 常用命令
    mongodb too many users are authenticated
  • 原文地址:https://www.cnblogs.com/kazihuo/p/9325855.html
Copyright © 2011-2022 走看看