#!/bin/bash #安装依赖 yum update -y yum install wget -y yum install gcc -y yum install zlib1g zlib1g-dev -y yum install libssl-dev -y yum install pcre-devel -y yum install openssl openssl-devel -y yum install make -y
#指定nginx资源路径 cd /usr/local mkdir nginx cd nginx wget http://nginx.org/download/nginx-1.18.0.tar.gz tar -xvf nginx-1.18.0.tar.gz
#进入nginx目录,执行configure脚本 cd /usr/local/nginx/nginx-1.18.0 ./configure #执行make命令 cd /usr/local/nginx/nginx-1.18.0 make #执行make install命令 cd /usr/local/nginx/nginx-1.18.0 make install
#进入nginx启动目录 cd /usr/local/nginx/sbin #启动nginx ./nginx
|