1.更新yum源
yum update
2.安装nginx的依赖环境
yum install -y gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
gcc-c++:安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境。
pcre pcre-devel :PCRE(Perl Compatible Regular Expressions) 是一个Perl库,包括 perl 兼容的正
则表达式库。nginx 的 http 模块使用 pcre 来解析正则表达式,所以需要在 linux 上
安装 pcre 库,pcre-devel 是使用 pcre 开发的一个二次开发库。nginx也需要此库。
zlib zlib-devel:zlib库提供了很多种压缩和解压缩的方式,nginx使用zlib对http包的内容进行gzip
openssl openssl-devel:OpenSSL 是一个强大的安全套接字层密码库,囊括主要的密码算法、常用的密钥和证
书封装管理功能及 SSL 协议,并提供丰富的应用程序供测试或其它目的使用。nginx
安装
cd /download
tar -zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make install
配置
注意:本文归作者所有,未经作者允许,不得转载