1.官网下载nginx
2.安装环境 jdk gcc openssl
yum install -y java-1.8.0-openjdk* 安装jdk1.8
yum install -y gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel unzip
3.linux安装nginx
cd /usr/local/src
mkdir nginx
cd nginx
把下载的tar包导入该文件夹
tar -zxvf nginx-1.21.6.tar.gz
cd nginx-1.21.6
./configure --prefix=/usr/local/nginx
./configure --prefix 命令是配置安装的路径,便于集中管理某个软件的各种文件
/usr/local/nginx/sbin/nginx -c /usr/local/src/nginx/nginx-1.21.6/conf/nginx.conf 指定配置文件启动