源码方式安装
- yum -y install wget
- wget http://nginx.org/download/nginx-1.20.2.tar.gz
- tar -zxvf nginx-1.20.2.tar.gz(解压到/usr/local ==>重命名为 nginx)
- 进入nginx目录
yum -y install pcre pcre-devel —正则表达式
yum -y install zlib zlib-devel —原始库
yum install -y openssl openssl-devel —做https服务的包 - ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module
#–prefix 指定安装目录
#–with-http_ssl_module 安装https模块
#creating objs/Makefile 代表编译成功 - make install
#make编译
#make install安装 - 启动 ./nginx
- 关闭 ./nginx -s stop