1 介绍

官网:https://nginx.org/en/download.html

windows版本就不多说了,原理一模一样,下面直接介绍linux

下载:

wget https://nginx.org/download/nginx-1.20.2.tar.gz

2 安装

  1. gcc-----------------必不可少的
  2. zlib-----------------gzip需要
  3. openssl(包括openssl-devel)-----SSL支持需要
  4. pcre(包括pcre-devel)--------让nginx支持正则表达式

2.1 环境准备

# 先安装gcc-c++编译器
yum install gcc-c++
yum install -y openssl openssl-devel
# 再安装pcre包
yum install -y pcre pcre-devel
# 再安装zlib包
yum install -y zlib zlib-devel

2.2 安装nginx

tar -zxvf nginx-1.20.2.tar.gz

使用nginx默认配置

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

编译安装

make && make install

3 启动/重载

启动

/usr/local/nginx/sbin/nginx

重载

/usr/local/nginx/sbin/nginx -s reload

查看进程

ps -ef | grep nginx

报错

PRCE
./configure: error: the HTTP rewrite module requires the PCRE library
编译时权限不足
/usr/bin/install: cannot create regular file ‘/usr/local/lib/libpcre.so.1.2.13‘: Permission denied

Nginx开启SSL模块
nginx: [emerg] the “ssl” parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:119
查看nginx原有的模块

[root@root sbin]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.20.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
configure arguments: --prefix=/usr/local/nginx

新配置信息就应该这样写

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make

这里不要进行make install,否则就是覆盖安装
然后备份原有已安装好的nginx

cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

然后将刚刚编译好的nginx覆盖掉原有的nginx(这个时候nginx要停止状态)

ps -ef|grep nginx
kill -QUIT 2072
cp ./objs/nginx /usr/local/nginx/sbin/

启动查看

/usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx -V

unbuntu nginx安装详解 /configure: error: the HTTP rewrite module requires the PCRE library相关推荐

  1. ./configure: error: the HTTP rewrite module requires the PCRE library

    报错 ./configure: error: the HTTP rewrite module requires the PCRE library. 解决方法 安装PRCE 官网:https://ftp ...

  2. centos7 安装nginx报错./configure: error: the HTTP rewrite module requires the PCRE library

    安装pcre-devel解决问题 yum -y install pcre-devel

  3. ngingx安装错误 ./configure: error: the HTTP rewrite module requires the PCRE library.

    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1.  ngnix 安装报错: 2. 解决: 安装pcre-devel解决问题,运行命令 yum - ...

  4. ./configure: error: the HTTP gzip module requires the zlib library.

    完整问题复现如下: ./configure: error: the HTTP gzip module requires the zlib library. You can either disable ...

  5. Nginx——安装详解

    Nginx的安装需要四个依赖:gcc.pcre.zlib.openssl yum -y install gcc pcre pcre-devel zlib zlib-devel openssl open ...

  6. Nginx源码包安装详解

    源码包安装详解 1.源码获取 2.如何安装源码 3.源码获取存放 3.1创建源码存放目录 3.2把源码移到需要存放的目录 3.3解压文件 3.4常用命令介绍 4.源码安装实际操作 4.1官网获取源码包 ...

  7. 编译Nginx提示gzip module requires the zlib library

    编译Nginx提示gzip module requires the zlib library 新手在尝试安装nginx时,常常会因为缺少依赖组件,导致nginx相应模块无法安装,在执行"./ ...

  8. nginx学习简介-安装-启动-命令-nginx配置文件详解

    nginx是什么:nginx是一个高性能的HTTP和反向代理web服务器.同时也提供了IMAP/POP3/SMTP服务. nginx特点:开源.占内存少.轻量级.高性能(有报告表面nginx能支持高达 ...

  9. 编译安装Nginx步骤详解

    编译安装Nginx步骤详解 1,去Nginx官方网站下载源码包并解压 curl -O 或wget 跟下载链接 tar -xf 解压 2,进入nginx解压后的目录执行./configure - ./c ...

最新文章

  1. ElasticSearch 2 (26) - 语言处理系列之打字或拼写错误
  2. android7.1增加一个开机自启动的bin应用遇到的权限问题
  3. (三)协同过滤算法之基于物品的推荐算法python实现
  4. 一天一道算法题--6.15--卡特兰数
  5. python3 gui协程_Python3进阶-协程
  6. SpringBoot集成Spring Security(1)——入门程序
  7. 李彦宏说互联网思维已过时,AI可以根本上变革交通、城市、农业和医疗
  8. 数据库联接字符串大全
  9. (一〇二)静态库(.a)的打包
  10. 百面机器学习—模型复杂度与模型的方差、偏差的关系
  11. 基于DEM,Lumion和WorldMachine的地形三维可视化
  12. MTK山寨机个性化DIY移植MRP初步探讨
  13. Android阿里云推送离线通知集成踩坑之路
  14. 为什么要学习Linux内核,如何学习?
  15. 一图搞懂梯度、散度、旋度、Jacobian、Hessian、Laplacian之间的关系
  16. 人工智能就业前景如何?
  17. ALG 求单峰的位置
  18. java ecb加密_AES(Rijndael)算法ECB模式加密
  19. ES8新特性 async,await实现异步
  20. 英语四六级常用八种时态

热门文章

  1. 前端发给后台的参数中含有中文
  2. Android 使用ORMLite 操作数据库
  3. twitter storm学习 - 安装部署问题汇总
  4. vim的配置管理和部署
  5. winform datagridview 合并单元格
  6. Pair Programming 1 (Casual Game) 曹竹 杨牧 贪吃蛇游戏扩展 Blog Report
  7. Android ActionBar完全解析,使用官方推荐的最佳导航栏(上)
  8. Operation not allowed after ResultSet closed--操作mysql数据库
  9. javascript必知必会之prototype
  10. Div span 标签详解