一、安装说明

系统环境:CentOS Linux release 7.2.1511 (Core)
系统内核:3.10.0-327.el7.x86_64
软件:nginx-1.10.1.tar.gz
其他所需软件:pcre-devel 、openssl-devel 、GeoIP-devel 、zlib-devel
安装方式:源码编译安装
安装位置:/usr/local/nginx

二、安装前提

安装nginx之前,确保系统安装了g++、gcc

1.安装pcre-devel

rewrite模块需要 pcre 库

$ sudo yum install pcre-devel -y

2.安装openssl-devel

ssl 功能需要openssl库

$ sudo yum install openssl-devel -y

3.安装zlib-devel

gzip模块需要 zlib 库

$ sudo yum install zlib-devel  -y

4.安装GeoIP-devel

$ sudo yum install GeoIP-devel -y  

三、安装nginx

1.创建用户

# useradd -M -s /sbin/nologin  www

2.解压

# tar zxf  nginx-1.10..tar.gz   -C /usr/local/

3.进入源码包目录

# cd /usr/local/nginx-1.10./

4.配置

./configure  \
--user=www \
--group=www \
--prefix=/usr/local/nginx \
--sbin-path=/usr/sbin/nginx \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--lock-path=/var/lock/nginx.lock \
--pid-path=/var/run/nginx.pid \
--with-debug \
--with-threads \
--with-http_ssl_module \
--with-http_geoip_module \
--with-http_gzip_static_module \
--with-http_gunzip_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_sub_module \
--with-http_stub_status_module \
--with-ipv6

5.编译安装

# make  && make install

6.创建目录

#  mkdir -pv /var/cache/nginx/client_temp 

7.验证

# nginx -V

8.启动、重载

启动

#  /usr/sbin/nginx 

重载

#  /usr/sbin/nginx  -s reload

9.停止

查询nginx主进程号

# ps aux|grep nginx

停止进程

# kill -QUIT 主进程号

快速停止

# kill -TERM 主进程号

强制停止

# pkill - nginx

10.测试

测试端口

# netstat -lnupt|grep 

四、配置说明

1.安装位置

/usr/local/nginx

2.配置文件位置

/usr/local/nginx/conf

3.二进制执行文件

/usr/sbin/nginx

configure执行结果

Configuration summary
+ using threads
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/var/run/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/var/cache/nginx/client_temp"
nginx http proxy temporary files: "/var/cache/nginx/proxy_temp"
nginx http fastcgi temporary files: "/var/cache/nginx/fastcgi_temp"
nginx http uwsgi temporary files: "/var/cache/nginx/uwsgi_temp"
nginx http scgi temporary files: "/var/cache/nginx/scgi_temp"

nginx安装(正式)的更多相关文章

  1. Windows下将nginx安装为服务运行

    今天看到nginx这个小服务器软件正式版更新到了1.4.2,想玩下它.这个服务器软件虽小,但功能强大,是开源软件,有着良好的性能,被很多个人.企业,甚至大型企业所使用! 由于是在Windows下,所以 ...

  2. Linux系统下的Nginx安装

    nginx可以使用各平台的默认包来安装,本文是介绍使用源码编译安装,包括具体的编译参数信息. 正式开始前,编译环境gcc g++ 开发库之类的需要提前装好,这里默认你已经装好. ububtu平台编译环 ...

  3. LVS + Keepalived + Nginx安装及配置

    1.概述 上篇文章<架构设计:负载均衡层设计方案(6)——Nginx + Keepalived构建高可用的负载层>(http://blog.csdn.net/yinwenjie/artic ...

  4. Nginx安装(zhuan)

    http://www.nginx.cn/install ************************ nginx可以使用各平台的默认包来安装,本文是介绍使用源码编译安装,包括具体的编译参数信息. ...

  5. sentos nginx安装

    nginx可以使用各平台的默认包来安装,本文是介绍使用源码编译安装,包括具体的编译参数信息. 正式开始前,编译环境gcc g++ 开发库之类的需要提前装好,这里默认你已经装好. ububtu平台编译环 ...

  6. Nginx安装第二步手动下载依赖包

    nginx可以使用各平台的默认包来安装,本文是介绍使用源码编译安装,包括具体的编译参数信息. 正式开始前,编译环境gcc g++ 开发库之类的需要提前装好,这里默认你已经装好. ububtu平台编译环 ...

  7. 架构设计:负载均衡层设计方案(7)——LVS + Keepalived + Nginx安装及配置

    1.概述 上篇文章<架构设计:负载均衡层设计方案(6)——Nginx + Keepalived构建高可用的负载层>(http://blog.csdn.net/yinwenjie/artic ...

  8. Nginx安装部署与测试

    场景:项目需要部署在生产环境中,这些新的工具都需要在生产环境中去实践练习.有时间再部署一套ELK的日志分析系统,这样的系统才算具有一定的应用价值. 1 Nginx安装 用root用户安装,采用源代码编 ...

  9. Nginx安装、平滑升级与虚拟机配置

    Nginx 高性能HTTP反向代理服务器,也是 LAMP/POP3/SMTP代理服务器 由内核和模块组成,内核通过找配置文件讲客户端请求映射到一个location(location是Nginx配置中的 ...

  10. Nginx安装及配置详解

    nginx概述 nginx是一款自由的.开源的.高性能的HTTP服务器和反向代理服务器:同时也是一个IMAP.POP3.SMTP代理服务器:nginx可以作为一个HTTP服务器进行网站的发布处理,另外 ...

随机推荐

  1. BitmapImage使用FileStream读取文件

    var bitmapImage = new BitmapImage(); using (FileStream fs = new FileStream(file.FullName, FileMode.O ...

  2. Dev-C++程序正确闪退问题

    只需要在主函数最后一句语句上面加一句getchar();即可

  3. Ubuntu下MySQL配置为外网访问

    Ububtu安装MySQL后默认外网无法连接,但是很多时候我们想要在外网访问方便管理.在这里,简单叙述一下自己在配置过程中的操作,步骤如下: 以root身份登入mysql mysql -u root ...

  4. jquery 20行代码实现简单轮播效果

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  5. Graphics2D 中文乱码

    今天遇到了一个乱码问题,合成的小票图片上的中文全部变成了口口口,后来在网上查了资料,发现是Graphics2D用了宋体字,而linux服务器上没有对应的字体库. 把本地的字体库上传上去就解决了. 本地 ...

  6. centos 6.5网卡dhcp不能获得网关

    环境:vmware +centos6.5 添加两个虚拟网卡.一个自动获取ip(用于上网-桥接) 一个手动(与主机通信用于ssh-NAT).  因为自已手动改了一下ifcfg-eth0里面的HWADDR ...

  7. 微星b85(b85i b85-gaming) 系列dsdt

    从网友得了一个b85-gaming 的dsdt,发现跟我的b85i的dsdt错误都是一样的. 发布上来给需要的人参考. 微星这个系列的dsdt不能用dsdt editor的fix功能,不然文件会越来越 ...

  8. Properties配置文件

    package file; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; ...

  9. Android的理解

    从组件的角度来考虑 Activity------------------Service-----------------Broadcast Receiver---------------------- ...

  10. 51单片机C语言学习笔记6:51单片机C语言头文件及其使用

    很多初学单片机者往往对C51的头文件感到很神秘,而为什么要那样写,甚至有的初学者喜欢问,P1口的P为什么要大写,不大写行不行呢?其实这个是在头文件中用sfr定义的,现在定义好了的是这样的 sfr P1 ...