1、安装更新gcc
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
2、创建nginx文件夹
cd /usr/local
mkdir nginx
3、 解压
tar -xvf nginx-1.23.1.tar.gz
4、运行configure文件(用来配置编译环境)
cd nginx-1.23.1/
./configure
5、编译
make
6、 安装
make install
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
cd /usr/local
mkdir nginx
tar -xvf nginx-1.23.1.tar.gz
cd nginx-1.23.1/
./configure
make
make install