Advertisement

nginx: 服务未识别已解决问题

阅读量:

问题产生

在使用centOS系统的过程中,当在终端中运行以下命令:

#service nginx start

时,出现了如下错误提示:

nginx: unrecognized service

问题解决

1.进入指定目录

#cd /etc/init.d/

2.创建名为nginx的脚本文件

#sudo vim nginx

3.脚本的具体内容

复制代码
    #!/bin/sh 
    # 
    # nginx - this script starts and stops the nginx daemon 
    # 
    # chkconfig:   - 85 15 
    # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ 
    #               proxy and IMAP/POP3 proxy server 
    # processname: nginx 
    # config:      /etc/nginx/nginx.conf 
    # config:      /etc/sysconfig/nginx 
    # pidfile:     /var/run/nginx.pid 
    
    # Source

全部评论 (0)

还没有任何评论哟~