在centos下启动nginx出现Failed to start nginx.service:unit not found
错误的原因就是没有添加nginx服务,所以启动失败。
解决方法:
在/root/etc/init.d/目录下新建文件,文件名为nginx
或者用命令在根目录下执行:# vim /etc/init.d/nginx (注意vim旁边有一个空格)
插入以下代码
#!/bin/sh
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an H
转载
2020-12-29 19:31:33 ·
675 阅读 ·
0 评论