Error when starting nginx in systemctl mode under centos
天蓬老师
天蓬老师 2017-05-16 17:15:10
0
3
636

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.
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
Peter_Zhu

If the directory exists, permission issues should be considered

巴扎黑

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.

大家讲道理

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template