Nginx启动关闭命令:
启动Nginx:
# cd /usr/local/nginx/sbin
# ./nginx
关闭nginx:
强制关闭: # ./nginx -s stop
快速关闭: # ./nginx -s quit
Nginx快速安装:
1. 安装 gcc
# yum install gcc-c++
2. 安装 PCRE pcre-devel
# yum install -y pcre pcre-devel
3. 安装 zlib
# yum install -y zlib zlib-devel
4. 安装 OpenSSL
# yum install -y openssl openssl-devel
5. 查看最新版下载地址 (一般使用 Stable Version 稳定版)
https://nginx.org/en/download.html
6. 通过下载地址下载文件
# wget https://nginx.org/download/nginx-1.13.6.tar.gz
7. 解压文件
# tar -zxvf nginx-1.10.1.tar.gz
8. 进入解压后的文件目录
# cd nginx-1.13.6
9.执行配置.
SSL证书模块, HTTP2 模块 (建议选这个, 模块比较齐全)
# ./configure --prefix=/usr/local/nginx --with-pcre --with-stream --with-stream_ssl_module --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-threads
安装时附带SSL证书模块, 如果没有ssl不能配置HTTPS
# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
10. 编译文件
# make
11.安装文件
# make install
12.启动nginx
# cd /usr/local/nginx/sbin/
# ./nginx