Heim  >  Fragen und Antworten  >  Hauptteil

centos - 在 nginx 服务中读取信息时出错:没有那个文件或目录

在 CentOS 安装了 Nginx,每次都是通过 /usr/local/nginx/html/nginx 命令来启动,我想设置为开机自动启动该服务,在网上搜到:chkconfig --level 345 nginx on
可是运行后却提示:在 nginx 服务中读取信息时出错:没有那个文件或目录
请问这是什么意思呢?要怎么弄才行,请教下各位,谢谢了~

漂亮男人漂亮男人2734 Tage vor1309

Antworte allen(1)Ich werde antworten

  • phpcn_u1582

    phpcn_u15822017-04-24 16:01:14

    chkconfig --level 345 nginx on 这个命令你先要在 /etc/init.d 下有 nginx 这个启动配置文件,网上有很多这个配置文件。但是这个配置文件要具体跟你的 nginx 程序的目录,配置文件的目录做相应的调整。

    我的意见就是简单的将 /usr/local/nginx/html/nginx 写入 /etc/rc.local 中。也会开机启动,不过是在分别的 level 里面的程序启动后再执行的。效果一样,其他程序基本不会依赖 nginx 启动的.

    Antwort
    0
  • StornierenAntwort