docs: 更新多个技术文档内容

更新Nginx安装指南,添加源码编译和AlmaLinux安装方法
补充Linux系统监控文档,增加网络和PCI/USB设备信息
新增WSL2安装配置文档
完善Vim编辑器文档,增加安装和基础命令
扩展Linux软件安装文档,添加MySQL、Redis、Node.js等安装指南
This commit is contained in:
2026-04-17 10:42:41 +08:00
parent 99e61e24c4
commit f1f3aac13b
5 changed files with 1644 additions and 88 deletions
+46
View File
@@ -5,6 +5,52 @@ tags: [Nginx, 反向代理, Web服务器, 负载均衡]
categories: [运维, Web服务器]
---
# Nginx 安装
## 源码编译安装
```shell
tar -zxvf nginx-1.21.4.tar.gz
cd nginx-1.21.4/
./configure
make
make install
```
## AlmaLinux/RHEL 安装
```shell
# 确保软件是最新的
sudo dnf clean all
sudo dnf update
sudo dnf groupinstall "Development Tools"
# 安装 Nginx
sudo dnf install nginx
# 启动并设置开机自启
sudo systemctl restart nginx
sudo systemctl status nginx
sudo systemctl enable nginx
# 配置防火墙
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
```
## 目录结构
| 目录/文件 | 说明 |
|-----------|------|
| `/etc/nginx` | 包含所有 Nginx 配置文件的主目录 |
| `/etc/nginx/nginx.conf` | 主要的 Nginx 配置文件 |
| `/etc/nginx/sites-available` | 定义各个网站的目录 |
| `/etc/nginx/sites-enabled` | Nginx 积极服务的网站列表 |
| `/var/log/nginx` | Nginx 日志目录 |
---
## Nginx 隐藏版本号
nginx配置文件`nginx.conf`里增加 server_tokens off;