nginx-1.10.3 编译安装
1、系统环境
[root@crazy-acong ~]# cat /etc/redhat-release
CentOS release 6.6 (Final) [root@crazy-acong ~]# uname -a
Linux crazy-acong 2.6.-.el6.x86_64 # SMP Wed Oct :: UTC x86_64 x86_64 x86_64 GNU/Linux [root@crazy-acong ~]# ifconfig eth0 | grep "inet addr" | awk -F : '{print $2}'| awk '{print $1}'
192.168.1.106
2、安装步骤
2.1 安装基础依赖包
- 安装 pcre
- 安装 openssl-devel
# pcre 安装
# 安装 pcre库是为了使 nginx 支持具备 URI 重写功能的 rewrite 模块,如果不安装 pcre 库,则 nginx 无法使用 rewrite 模块功能
[root@crazy-acong ~]# yum -y install pcre pcre-devel [root@crazy-acong ~]# rpm -qa pcre pcre-devel
pcre-devel-7.8-.el6.x86_64
pcre-7.8-.el6.x86_64 # openssl-devel 安装
# nginx 在使用HTTPS服务的时候要用到此模块,如果不安装 openssl 相关包,安装 nginx 的过程中会报错。openssl 系统默认已经安装,只需要安装 openssl-devel 即可
[root@crazy-acong ~]# yum -y install openssl-devel [root@crazy-acong ~]# rpm -qa openssl-devel openssl
openssl-1.0.1e-.el6_8..x86_64
openssl-devel-1.0.1e-.el6_8..x86_64
2.2 安装 nginx
# 创建软件包存放目录
[root@crazy-acong ~]# mkdir -p /data/tools
[root@crazy-acong ~]# cd /data/tools/ # 下载 nginx 的稳定版本 1.10.
[root@crazy-acong tools]# wget http://nginx.org/download/nginx-1.10.3.tar.gz # 创建 nginx 用户
[root@crazy-acong tools]# useradd nginx -s /sbin/nologin -M
[root@crazy-acong tools]# tar -zxf nginx-1.10..tar.gz
[root@crazy-acong tools]# cd nginx-1.10. [root@crazy-acong nginx-1.10.]# ./configure --user=nginx --group=nginx --prefix=/data/application/nginx-1.10. --with-http_stub_status_module --with-http_ssl_module [root@crazy-acong nginx-1.10.]# make
[root@crazy-acong nginx-1.10.]# make install [root@crazy-acong nginx-1.10.]# ln -s /data/application/nginx-1.10./ /etc/nginx [root@crazy-acong nginx-1.10.]# ln -s /data/application/nginx-1.10./sbin/nginx /usr/local/sbin/ # 使用 nginx -V 可以查看编译是的参数
[root@crazy-acong ~]# /etc/nginx/sbin/nginx -V
nginx version: nginx/1.10.
built by gcc 4.4. (Red Hat 4.4.-) (GCC)
built with OpenSSL 1.0.1e-fips Feb
TLS SNI support enabled
configure arguments: --user=nginx --group=nginx --prefix=/data/application/nginx-1.10./ --with-http_stub_status_module --with-http_ssl_module # 检查配置文件语法,可以防止因配置错误导致网站重启或重新加载配置等对用户的影响
[root@crazy-acong nginx-1.10.]# nginx -t
nginx: the configuration file /data/application/nginx-1.10.//conf/nginx.conf syntax is ok
nginx: configuration file /data/application/nginx-1.10.//conf/nginx.conf test is successful # 启动 nginx 服务
[root@crazy-acong nginx-1.10.]# nginx # 查看是否启动成功
[root@crazy-acong nginx-1.10.]# netstat -lnpt | grep nginx
tcp 0.0.0.0: 0.0.0.0:* LISTEN /nginx
nginx-1.10.3 编译安装的更多相关文章
- centos 7 下 nginx 1.10.3 编译安装的方法
安装所需环境 Nginx 是 C语言 开发,建议在 Linux 上运行,当然,也可以安装 Windows 版本,本篇则使用 CentOS 7 作为安装环境. 一. gcc 安装安装 nginx 需要先 ...
- ubuntu15.10下编译安装wine1.8 rc4
ubuntu15.10下编译安装wine1.8rc4 Wine (“Wine Is Not an Emulator” 的递归缩写)是一个能够在多种 POSIX-compliant 操作系统(诸如 Li ...
- 新安装和已安装nginx如何添加未编译安装模块/补丁
新安装和已安装nginx如何添加未编译安装模块/补丁 --http://www.apelearn.com/bbs/forum.php?mod=viewthread&tid=10485& ...
- 安装成功的nginx如何添加未编译安装模块
原已经安装好的nginx,现在需要添加一个未被编译安装的模块举例说明:安装第三方的ngx_cache_purge模块(用于清除指定URL的缓存)nginx的模块是需要重新编译nginx,而不是像apa ...
- F-stack及其Nginx、redis的编译安装
F-stack简介 F-stack粘合了dpdk.用户态协议栈和nginx.redis,弥补了dpdk没有协议栈的不足,并用nginx.redis提供了一个调用应用程序的接口. Quick Start ...
- 转:安装成功的nginx如何添加未编译安装模块
原已经安装好的nginx,现在需要添加一个未被编译安装的模块 举例说明:安装第三方的ngx_cache_purge模块(用于清除指定URL的缓存) nginx的模块是需要重新编译nginx,而不是像a ...
- Nginx之解压编译安装-yellowcong
安装前准备 对于nginx编译安装需要先安装编译 的工具,然后再安装nginx依赖 yum -y install gcc gcc-c++ autoconf automake make yum -y i ...
- 生产线上的Nginx如何添加未编译安装模块
正在生产线上跑着web前端是nginx+tomcat,现在有这样一个需求,需要对网站的单品页面和列表页设置缓存,不同的页面设置不同的缓存,但是由于开始没有安装ngx_cache_purge这个模块,现 ...
- Nginx 1.10.1 编译、配置文档(支持http_v2,TLSv1.2,openssl v1.0.2)
1.安装常用工具及基础包: [root@localhost /]# yum -y install wget git vim make gcc gcc-c++ openssl-devel [root@l ...
随机推荐
- NYOJ82 迷宫寻宝(一)【BFS】
迷宫寻宝(一) 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描写叙述 一个叫ACM的寻宝者找到了一个藏宝图.它依据藏宝图找到了一个迷宫,这是一个非常特别的迷宫,迷宫里有N个 ...
- react-native 创建 ios 项目
创建React-Native项目 打开终端输入react-native init ProjectName,这里的ProjectName可以改成你想创建的项目名称.然后有两种方法启动项目 1.从终端开启 ...
- flex布局 (回顾)
1.父元素 属性 display:flex; // 必写 justify-content: XXX; // 设置子容器沿主轴排列 align-items: XXX; // 设置子容器如何沿交叉轴排列 ...
- sort-colors——排序3种数字
题目描述 Given an array with n objects colored red, white or blue, sort them so that objects of the same ...
- 我是怎样理解web页面的
事实上web页面包括三部分东东 1.页面展示的元素(HTML) 2.页面元素展示的样式(CSS) 3.控制页面元素的交互(JavaScript) 不管页面多么复杂,从这三方面去看,都会得到清晰的认识的 ...
- Iocomp控件教程之LinearGauge--线性刻度尺控件
线性刻度尺-线性刻度尺控件(LinearGauge)是一个具有线性表达式刻度的图像控件.支持多达5种颜色断面和4种指示器样式,相同功能,查看线性对数刻度尺(Linear Log Gauge)控件内容 ...
- CSS实现绝对定位居中
我们经常用margin:0 auto来实现水平居中,而一直认为margin:auto不能实现垂直居中……实际上,实现垂直居中仅需要声明元素高度和下面的CSS: .Absolute-Center { m ...
- squid cache 服务器端的安装,配置
一,什么squid Squid是一个高性能的代理缓存服务器,可以加快内部网浏览Internet的速度,提高客户机的访问命中率.Squid不仅支持HTTP协议, 还支持FTP.gopher.SSL和WA ...
- Spring事务管理之声明式事务管理-基于注解的方式
© 版权声明:本文为博主原创文章,转载请注明出处 案例 - 利用Spring的声明式事务(TransactionProxyFactoryBean)管理模拟转账过程 数据库准备 -- 创建表 CREAT ...
- wc 命令
Linux系统中的wc(Word Count)命令的功能为统计指定文件中的字节数.字数.行数,并将统计结果显示输出. 1.命令格式: wc [选项]文件... 2.命令功能: 统计指定文件中的字节数. ...