YUM安装nginx

centos 7的守护进程、工具和库的管理器是systemd。取代了之前的system v。Systemd的功能是用于集中管理和配置类UNIX系统。

systemctl 是 systemd的一个工具,主要负责控制systemd系统和服务管理器。

安装以后,要管理这些服务启动、重启、停止,以及设置开机自启动等,都是通过systemctl来管理。

使用详情:https://linux.cn/article-5926-1.html#3_782

[Nginx]

To add NGINX yum repository, create a file named /etc/yum.repos.d/nginx.repo and paste one of the configurations below:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

# yum update

# yum install nginx

#systemctl start nginx 启动服务

安装完成后,在浏览器中测试,成功打开欢迎页

#systemctl is-active nginx 查看服务是否已经启动

#systemctl is-enabled nginx 查看服务是否设置了开机自启动

#systemctl enable nginx 设置服务开机自启动

配置nginx:

转载于:https://www.cnblogs.com/mysic/p/5958733.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值