Press "Enter" to skip to content

Centos7配置Nginx服务到systemctl

在Centos7中,我们想要将安装的Nginx服务化,可以做如下操作:

然后添加如下代码并保存:

请注意nginx的安装位置,然后重新加载systemctl配置即可:

常用操作:

systemctl start nginx //启用服务
systemctl status nginx //查看状态
systemctl stop nginx //停用服务
systemctl restart nginx //重启服务
systemctl reload nginx //配置重载
systemctl enable nginx //开启自启
systemctl disable nginx //禁用自启

Comments are closed, but trackbacks and pingbacks are open.