官方文档:https://nginx.org/en/linux_packages.html#RHEL-CentOS
安装环境:Linux 服务器 CentOS 7.3、Root 权限
1、Install the prerequisites:
sudo yum install yum-utils
2、To set up the yum repository, create the file named /etc/yum.repos.d/nginx.repo with the following contents:
(注意替换 OS 版本:$releasever,如 centos 版本是 7,就替换成 7)
命令:
使用 vim 编辑 nginx.repo 文件
vim /etc/yum.repos.d/nginx.repo
设置 Nginx 的 yum 源:
将以下内容粘贴进 nginx.repo 文件中
[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 module_hotfixes=true
输入vim命令 :wq 保存并退出
3、To install nginx, run the following command:
sudo yum install nginx
中途会输入 y 确认安装
4、When prompted to accept the GPG key, verify that the fingerprint matches 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62, and if so, accept it.
最后会输出 fingerprint,如果和上面红色部分匹配,再输入 y 确认
5、启动 | 停止 | 重启 Nginx:
# 启动 systemctl start nginx.service # 停止 systemctl stop nginx.service # 重启 systemctl restart nginx.service
6、查看 Nginx 所有安装位置:
rpm 是 linux 的 rpm 包管理工具,-q 代表询问模式,-l 代表返回列表
rpm -ql nginx
7、Nginx 配置文件:
/etc/nginx/conf.d /etc/nginx/conf.d/default.conf
总结
以上所述是小编给大家介绍的CentOS下 安装 Nginx的方法,希望对大家有所帮助!
CentOS,安装,Nginx
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 群星《歌手2024 第4期》[FLAC/分轨][563.76MB]
- RiffKitten-ChaosParade(2024)[24-44,1]FLAC
- RuneKlakegg-Nattevandrer(2024)[24-96]\FLAC
- 赖冰霞.2006-金嗓典藏辑2IN1(南方金点系列)2CD【南方】【WAV+CUE】
- 群星.1988-国语金曲尽精英VOL.2【瑞成】【WAV+CUE】
- 张宇.1999-雨一直下【EMI百代】【WAV+CUE】
- 袁娅维.2021-月亮失眠了(DELUXE)【华纳】【FLAC分轨】
- AlanBroadbent-JazzFunk(2024)[24-44,1]
- 梅艳芳《绝代芳华》开盘母带[低速原抓WAV+CUE]
- ABC唱片-《外国精逊母带直刻神奇黑胶[APE+CUE].
- 群星《天赐的声音第五季 第6期》[320K/MP3][101.43MB]
- 群星《天赐的声音第五季 第6期》[FLAC/分轨][526.16MB]
- 群星《说唱梦工厂 第2期》[320K/MP3][96.37MB]
- 杨宗宪.1994-留你留袂着【有容唱片】【WAV+CUE】
- 李翊君.2005-勇敢的爱【创意唱片】【WAV+CUE】