https://www.digitalocean.com/community/tools/nginx?global.app.lang=zhCN
nginx企业用它干啥
```
1.提供静态页面展示,网页服务
2.提供多个网站、多个域名的网页服务
3.提供反向代理服务(结合动态应用程序)
4.提供简单资源下载服务(密码认证) ftp服务
5.用户行为分析(日志功能)
```
1. 配置官网yum源,一键安装即可
[root@web]#cat > /etc/yum.repos.d/nginx.repo << 'EOF'
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
EOF
2.清空yum源,安装最新版nginx
[root@web]#yum clean all
[root@web]#yum install nginx -y
3.查看PATH变量
[root@web]#which nginx
/usr/sbin/nginx
[root@web]#ll /usr/sbin/nginx
-rwxr-xr-x 1 root root 1377720 Nov 16 2021 /usr/sbin/nginx
[root@web]#nginx -V
nginx version: nginx/1.20.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
nginx -t # 检测nginx.conf语法
nginx -s reload # 重新读取nginx.conf
nginx -s stop # 停止nginx kill -15 nginx
nginx # 默认是直接运行,前提是当前机器没运行nginx