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

本文详细介绍了在Linux环境下从源码编译安装NGINX的步骤。首先通过wget下载NGINX压缩包,若wget未安装则需通过yum进行安装。接着解压NGINX并进入目录,使用./configure配置,遇到依赖缺失时分别安装pcre-devel和openssl及openssl-devel。最后执行make和make install完成安装。默认安装路径为/usr/local/nginx。

安装

1. 下载NGINX压缩包:

wget http://nginx.org/download/nginx-1.13.7.tar.gz

如果报错:bash: wget: command not found 那么运行:yum install wget

2. 解压NGINX:

执行命令:tar -zxvf nginx-1.13.7.tar.gz

3. 依次执行以下命令:

  1. 进入nginx执行命令:cd nginx-1.13.7

  2. 执行命令:./configure

    如果报错./configure: error: the HTTP rewrite module requires the PCRE library.
    * 安装pcre-devel解决问题:yum -y install pcre-devel

    如果再报错./configure: error: the HTTP cache module requires md5 functions from OpenSSL library.You can ...
    1. 安装openssl解决问题:yum -y install openssl openssl-devel
    2. 加参数执行命令:./configure --prefix=/usr/local/nginx

  3. 执行命令:

    make
    
  4. 执行命令:

    make install
    

注意: nginx一般默认安装好的路径为/usr/local/nginx

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值