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: