您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> Web开发 >> centos下以systemctl方式启动nginx报错

centos下以systemctl方式启动nginx报错

来源:网络整理     时间:2016/9/1 13:56:38     关键词:

关于网友提出的“ centos下以systemctl方式启动nginx报错”问题疑问,本网通过在网上对“ centos下以systemctl方式启动nginx报错”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: centos下以systemctl方式启动nginx报错
描述:

根据日志的提示是 /tmp/nginx/client_temp 这个目录不存在,但是我反复检查了好多遍,这个目录是存在的,我直接以 /usr/local/nginx/sbin/nginx 进行操作没有任何错误提示,实在是找不到原因在哪了,求大神指点迷津!!

错误如下:

[root@iZ94ss71ojfZ nginx]# systemctl status nginx
nginx.service - nginx - high performance web server
   Loaded: loaded (/etc/systemd/system/nginx.service; enabled)
   Active: failed (Result: exit-code) since Thu 2016-08-18 01:33:15 CST; 1s ago
     Docs: http://nginx.org/en/docs/
  Process: 15731 ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf (code=exited, status=1/FAILURE)

Aug 18 01:33:15 iZ94ss71ojfZ systemd[1]: Starting nginx - high performance web server...
Aug 18 01:33:15 iZ94ss71ojfZ nginx[15731]: nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
Aug 18 01:33:15 iZ94ss71ojfZ nginx[15731]: nginx: [emerg] mkdir() "/tmp/nginx/client_temp" failed (2: No such file or directory)
Aug 18 01:33:15 iZ94ss71ojfZ nginx[15731]: nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
Aug 18 01:33:15 iZ94ss71ojfZ systemd[1]: nginx.service: control process exited, code=exited status=1
Aug 18 01:33:15 iZ94ss71ojfZ systemd[1]: Failed to start nginx - high performance web server.
Aug 18 01:33:15 iZ94ss71ojfZ systemd[1]: Unit nginx.service entered failed state.

解决方案1:

试试nginx -c your_conf_file,如果这个能成功,一般是权限问题。

解决方案2:

看着像是缓存的路径配置有问题,题主可以查看配置文件为啥会有这个路径"/tmp/nginx/client_temp",如果是有意为之,则要确保该路径存在、并且有相应的读写权限。

解决方案3:

目录如果存在,应该要考虑权限问题


以上介绍了“ centos下以systemctl方式启动nginx报错”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/3706121.html

相关图片

相关文章