添加文档

修改主题配置
This commit is contained in:
xzh
2025-03-27 18:29:25 +08:00
parent 185e180f09
commit f45ac97711
18 changed files with 1406 additions and 190 deletions

View File

@@ -0,0 +1,67 @@
---
title: nginx安装
date: 2021-11-21
updated: 2021-11-21
tags:
- nginx
- linux
categories:
- linux
- nginx
keywords:
- nginx
- linux
description: nginx安装
top_img: https://i.loli.net/2021/11/21/wcEIMzN795yV1Uh.jpg
comments: true
cover: https://i.loli.net/2021/11/21/wcEIMzN795yV1Uh.jpg
copyright: true
copyright_author: xzh
copyright_author_href: http://xxzhx.cn
copyright_url: http://xxzhx.cn
copyright_info: 著作权归作者所有。商业转载请联络作者获得授权,非商业转载请注明出处。
---
# nginx安装
## 下载nginx包
[下载地址](http://nginx.org/en/download.html)
![nginx包](https://i.loli.net/2021/11/20/Nx27vqALlSJntOj.png)
## 安装依赖
```shell
yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
```
## 安装nginx
```shell
# 解压
tar -zxvf nginx-1.20.2.tar.gz
# 进入nginx文件夹
cd nginx-1.20.2/
# 配置
./configure --prefix=/usr/local/nginx-1.20.2
# make
make
make install
```
## 启动&停止
```shell
# 进入nginx安装目录
cd /usr/local/nginx-1.20.2/
# 启动
./sbin/nginx
# 重启
./sbin/nginx -s reload
# 停止
./sbin/nginx -s stop
```