Linux下源码编译安装Nginx

本文介绍如何在CentOS操作系统上安装Nginx。包括下载源码包、解压、配置安装路径、添加SSL模块等功能。解决安装过程中可能遇到的问题,如缺少HTTP重写模块所需的PCRE库和SSL模块所需的OpenSSL库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

操作系统:Centos

下载源码包

http://nginx.org/en/download.html

解压

# tar -zxvf nginx-1.12.2.tar.gz 

编译安装

# cd nginx-1.12.2

指定安装路径及添加SSL模块功能

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

可能出现的问题:

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

 

    安装pcre-devel

 # yum install pcre-devel

    ./configure: error: SSL modules require the OpenSSL library.

    安装openssl-devel

# yum install openssl-devel

编译安装

# make && make install  

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值