yum -y install gcc gcc-c++ make libtool zlib zlib-devel openssl openssl-devel pcre pcre-devel
2.下载Nginx安装包
wget https://nginx.org/download/nginx-1.24.0.tar.gz
3.解压,进入解压目录
tar -zxvf nginx-1.18.0.tar.gz
4.配置安装运行目录
进入 cd nginx-1.24.0
./configure --prefix=/usr/local/nginx
5.安装依赖包
yum -y install pcre-devel yum -y install openssl openssl-devel
6.进行重新配置
./configure --prefix=/usr/local/nginx
7.执行编译安装
make && make install
8.安装完毕,进入Nginx下的sbin目录并启动nginx:
cd /usr/local/nginx/sbin/nginx
启动(执行)
./nginx
9.验证安装:在浏览器输入CentOS的IP地址(如果无法显示网页请检查Centos中的防火墙是否开放80端口)