search

Home  >  Q&A  >  body text

Error when starting nginx in systemctl mode under centos

According to the log prompt, the directory /tmp/nginx/client_temp does not exist, but I checked many times and found that this directory exists. I directly operated with /usr/local/nginx/sbin/nginx and there was nothing Error message, I really can’t find the reason, please give me some guidance!!

The error is as follows:

[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.
天蓬老师天蓬老师2754 days ago638

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-05-16 17:17:10

    If the directory exists, permission issues should be considered

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-16 17:17:10

    It seems that there is a problem with the cache path configuration. The questioner can check why the configuration file has this path "/tmp/nginx/client_temp". If it is intentional, make sure that the path exists and has the corresponding Read and write permissions.

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 17:17:10

    Try itnginx -c your_conf_file, if this works, it’s usually a permissions issue.

    reply
    0
  • Cancelreply