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
相关推荐
tingting011914 小时前
k8s 1.30 安装ingress-nginx
nginx·容器·kubernetes
残花月伴15 小时前
linux详细安装/配置(mysql/nginx/tomcat)
linux·mysql·nginx
Cloud_.19 小时前
用Nginx实现负载均衡与高可用架构(整合Keepalived)
nginx·架构·负载均衡·keepalived
Shi_haoliu19 小时前
各种网址整理-vue,前端,linux,ai前端开发,各种开发能用到的网址和一些有用的博客
linux·前端·javascript·vue.js·nginx·前端框架·pdf
LYX36931 天前
nginx https配置
运维·nginx
java搬砖工-苤-初心不变1 天前
关于 Nginx 配置中 proxy_set_header Host $host 的作用及其对 HTTP 请求头影响的详细说明,结合示例展示设置前后的差异
网络·nginx·http
裁二尺秋风1 天前
Nginx — Nginx处理Web请求机制解析
前端·nginx
Kendra9192 天前
Keepalive+LVS+Nginx+NFS高可用架构
nginx·架构·lvs
若云止水2 天前
ngx_http_core_main_conf_t
nginx
开发小能手-roy2 天前
Ubuntu 系统中安装 Nginx
数据库·nginx·ubuntu