Centos7下yum安装Nginx
安装步骤
安装必备组件
yum install yum-utils
配置yum
库, 创建文件 /etc/yum.repos.d/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
执行安装命令
yum install nginx
配置
服务相关
systemctl start nginx.service #(启动nginx服务)
systemctl stop nginx.service #(停止nginx服务)
systemctl enable nginx.service #(设置开机自启动)
systemctl disable nginx.service #(停止开机自启动)
systemctl status nginx.service #(查看服务当前状态)
systemctl restart nginx.service #(重新启动服务)
systemctl list-units --type=service #(查看所有已启动的服务)
-----------------------------------------------------------------------------------------------------------
薔薇猛虎皆成個性,陽光雨露俱是天恩!
薔薇猛虎皆成個性,陽光雨露俱是天恩!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· winform 绘制太阳,地球,月球 运作规律
· 上周热点回顾(3.3-3.9)