Cx330

Nginx 1.14

Nginx 1.14
2019-09-18 · 2 min read
develop server 运维 nginx

系统

CentOS7.x

准备工作

yum install -y gcc

yum install -y pcre pcre-devel

yum install -y zlib zlib-devel

yum install -y openssl openssl-devel

安装Nginx

wget http://nginx.org/download/nginx-1.14.2.tar.gz
tar -zxvf nginx-1.14.0.tar.gz
cd nginx-1.14.0/
./configure --prefix=/usr/local/nginx --pid-path=/run/nginx.pid  --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log  --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-pcre
make
make install

安装目录

默认Nginx安装在/usr/local/nginx/中

常用命令

/usr/local/nginx/sbin/nginx #默认启动方式 start

/usr/local/nginx/sbin/nginx -t #测试配置信息

/usr/local/nginx/sbin/nginx -v #显示版本信息,-V(大V)显示编译时的参数

/usr/local/nginx/sbin/nginx -s stop #快速停止服务

/usr/local/nginx/sbin/nginx -s quit #正常停止服务 

/usr/local/nginx/sbin/nginx -s reload #重启