[toc]
nginx安装
1.源码编译安装
1.1 下载nginx源码包
export NG_VERSION=1.22.0
wget https://nginx.org/download/nginx-${NG_VERSION}.tar.gz
1.2 编译安装nginx
1.2.1 创建www用户
useradd www -s /sbin/nologin -M
1.2.2 安装依赖包
yum -y install gcc gcc-c++ zlib zlib-devel openssl openssl-devel pcre-devel httpd-tools
1.2.3 解压缩包
tar xf nginx-${NG_VERSION}.tar.gz && cd nginx-${NG_VERSION}