#! /bin/bash
# atuo install nginx 1.18
# 2020年7月12日11:34:28
#by author ajay
##################################
echo "安装nginx 1.18"
# 安装linux 依赖包
yum install -y wget gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
## 下载nginx1.18
wget -c http://nginx.org/download/nginx-1.18.0.tar.gz
## 解压
tar -zxvf nginx-1.18.0.tar.gz
# 进入安装目录
cd nginx-1.18.0
# 添加用户
useradd -M -s /sbin/nologin -r www
# 预编译
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module
# 编译安装
make && make install
# 启动nginx
/usr/local/nginx/sbin/nginx
# 关闭selinux 和防火墙
setenforce 0
systemctl stop firewalld.service
# 查看linux
ps -ef | grep nginx
netstat -tnlp|grep 80
一键安装nginx1.18
最新推荐文章于 2024-07-08 20:10:18 发布