nginx安装详细步骤和使用说明

下载地址:
https://download.csdn.net/download/jinhuding/88463932

详细说明和使用参考:

地址:http://www.gxcode.top/code

一 nginx安装步骤:
1.nginx安装与运行

bash 复制代码
官网 http://nginx.org/

1.1安装gcc环境

bash 复制代码
# yum install gcc-c++

1.2安装PCRE库,用于解析正则表达式

bash 复制代码
# yum install -y pcre pcre-devel

1.3zlib压缩和解压缩依赖

bash 复制代码
# yum install -y zlib zlib-devel

1.4ssl安全的加密的套接字协议层,用于HTTP安全传输,也就是https

bash 复制代码
# yum install -y openssl openssl-devel

1.5解压tar

bash 复制代码
# tar -zxvf nginx-1.16.1.tar.gz

1.6 创建nginx临时目录,如果不创建在启动nginx的过程中会报错

bash 复制代码
mkdir /var/temp/nginx -p

1.7 在nginx目录,输入如下命令进行配置,目的是为了创建makefile文件[在nginx-1.16.1目录下]

bash 复制代码
/configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi

1.8 make编译[在nginx-1.16.1目录下]

bash 复制代码
make

1.9 安装[在nginx-1.16.1目录下]

bash 复制代码
make install 

1.10 查看nginx安装目录

bash 复制代码
whereis nginx
nginx:/usr/local/nginx

1.11 进入sbin目录启动nginx[cd /]

bash 复制代码
./nginx
./nginx -s stop
./nginx -s reload
相关推荐
脏脏a2 小时前
告别物理出勤:Nginx 搭配 cpolar 实现远程开发无缝协作
运维·nginx
Dxy123931021612 小时前
413 Request Entity Too Large 原因与解决方案
nginx
CYpdpjRnUE12 小时前
光储一体机仿真模型搭建之旅
nginx
Volunteer Technology21 小时前
FastDFS+Nginx
运维·nginx
qinyia1 天前
**使用AI助手在智慧运维中快速定位并修复服务异常:以Nginx配置错误导致502错误为例**
linux·运维·服务器·数据库·mysql·nginx·自动化
404Clukay1 天前
Windows Server 配置 Let‘s Encrypt 免费 HTTPS 证书(WACS + Nginx 自动化方案)
windows·nginx·https
一叶星殇1 天前
.NET6 解决 Nginx 反向代理后获取客户端真实 IP(始终显示网关 IP)问题
运维·服务器·nginx
qq_312920112 天前
Nginx+Keepalived双主架构:消除单点故障的最佳实践
运维·nginx·架构
ん贤2 天前
nginx语法
nginx
萧曵 丶2 天前
Nginx 高频面试题(含答案)
运维·nginx