我是靠谱客的博主 现实小白菜,这篇文章主要介绍nginx启动 start_nginx:Failed to start nginx.service:unit not found,现在分享给大家,希望可以做个参考。

3b215a8bfc861828a5757228730b201b.png

错误的原因就是没有添加nginx服务,所以启动失败。

解决方法:

1. 在/root/etc/init.d/目录下新建文件,文件名为nginx

  或者用命令在根目录下执行:# vim /etc/init.d/nginx (注意vim旁边有一个空格)

2. 插入以下代码

#!/bin/sh

3. 用命令进入此目录

cd /etc/init.d

4. 依此执行以下命令

chmod 755 /etc/init.d/nginx

chkconfig --add nginx (注意add前面是两个短横线-)

5. 开启nginx

service nginx start

最后

以上就是现实小白菜最近收集整理的关于nginx启动 start_nginx:Failed to start nginx.service:unit not found的全部内容,更多相关nginx启动内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(126)

评论列表共有 0 条评论

立即
投稿
返回
顶部