1.找个文件夹,下载包并解压
1.cd /usr/local/soft/nginx
2.wget http://nginx.org/download/nginx-1.18.0.tar.gz
3.tar -zxvf nginx-1.18.0.tar.gz
2.安装并启动
1 cd /usr/local/soft/nginx/nginx-1.18.0
2 ./configure
3 如果2报错 ./configure: error: the HTTP gzip module requires the zlib library
4 执行命令1 yum -y install pcre-devel
执行命令2 yum -y install openssl openssl-devel
5 没有报错,跳过3和4步,执行命令 make
6 执行命令 make install
7 cd /usr/local/nginx/sbin/
8 ./nginx
3.验证启动是否成功
ps -ef|grep nginx
4.启动成功页面