zoukankan      html  css  js  c++  java
  • linux Nginx 的安装

    确保安装了 gcc,openssl-devel,pcre-devel,zilb-devel

    下载官网:http://nginx.org/

    [root@localhost tools]# wget http://nginx.org/download/nginx-1.6.3.tar.gz

    --2017-10-21 10:43:52--  http://nginx.org/download/nginx-1.6.3.tar.gz

    Resolving nginx.org... 95.211.80.227, 206.251.255.63, 2001:1af8:4060:a004:21::e3, ...

    Connecting to nginx.org|95.211.80.227|:80... connected.

    HTTP request sent, awaiting response... 302 Found

    Location: http://101.247.192.67/files/32230000052D57CD/nginx.org/download/nginx-1.6.3.tar

    .gz [following]--2017-10-21 10:43:53--  http://101.247.192.67/files/32230000052D57CD/nginx.org/download/

    nginx-1.6.3.tar.gzConnecting to 101.247.192.67:80... connected.

    HTTP request sent, awaiting response... 200 OK

    Length: 805253 (786K) [application/octet-stream]

    Saving to: “nginx-1.6.3.tar.gz”

     

    100%[===============================================>] 805,253      840K/s   in 0.9s   

     

    2017-10-21 10:43:54 (840 KB/s) - “nginx-1.6.3.tar.gz” saved [805253/805253]

     

    [root@localhost tools]# ls

    nginx-1.6.3.tar.gz

    [root@localhost tools]# mkdir -p /application/nginx

    [root@localhost tools]# ls

    nginx-1.6.3.tar.gz

    [root@localhost tools]# tar -zxf nginx-1.6.3.tar.gz

    [root@localhost tools]# ls

    nginx-1.6.3  nginx-1.6.3.tar.gz

    [root@localhost tools]# cd nginx-1.6.3

     [root@localhost nginx-1.6.3]# useradd nginx -s /sbin/nologin -M

    [root@localhost nginx-1.6.3]# ./configure

    > --with-http_stub_status_module

    > --prefix=/application/nginx

    > --with-http_gzip_static_module

    > --user=nginx

    > --group=nginx

    [root@localhost nginx-1.6.3]# make&&make install

    [root@localhost nginx]# ln -s /application/nginx /application/nginx-1.6.3

    [root@localhost application]# /application/nginx/sbin/nginx -t

    nginx: the configuration file /application/nginx/conf/nginx.conf syntax is ok

    nginx: configuration file /application/nginx/conf/nginx.conf test is successful

    [root@localhost application]# /application/nginx/sbin/nginx

    [root@localhost /]# lsof -i :80

    COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

    nginx   6125  root    6u  IPv4  22127      0t0  TCP *:http (LISTEN)

    nginx   6126 nginx    6u  IPv4  22127      0t0  TCP *:http (LISTEN)

     

    #--with-http_stub_status_module 可以启用 nginx nginxstauts 功能,以监控 nginx 当前状态

  • 相关阅读:
    20171130-构建之法:现代软件工程-阅读笔记
    软件工程课程总结
    团队编程项目作业6-程序维护
    团队-象棋游戏-项目总结
    20171117-构建之法:现代软件工程-阅读笔记
    团队-象棋游戏-团队一阶段互评
    课后作业-阅读任务-阅读笔记-1
    课后作业-阅读任务-阅读提问-1
    课后作业-阅读任务-阅读提问-2
    阿里云部署node坑
  • 原文地址:https://www.cnblogs.com/fanweisheng/p/11328176.html
Copyright © 2011-2022 走看看