nginxopenresty

Install of openresty : nginx.pid not found


I try to install OpenResty 1.13.6.1 under CentOS 7. When I try to run openresty I get this error:

[root@flo ~]# openresty -s reload

nginx: [error] open() "/usr/local/openresty/nginx/logs/nginx.pid" failed (2: No such file or directory)

When I look at my logs, I only have 2 files:

[root@flo ~]# ll /usr/local/openresty/nginx/logs/

total 8

-rw-r--r--. 1 root root 0 1 mars 12:24 access.log

-rw-r--r--. 1 root root 4875 1 mars 16:03 error.log

I do not see how to find a solution.

///////////////////UPDATE//////////////////

I try to do this to folow the instructions of this page : https://openresty.org/en/getting-started.html

[root@flo ~]# PATH=/usr/local/openresty/nginx/sbin:$PATH

[root@flo ~]# export PATH

[root@flo ~]# nginx -p pwd/ -c conf/nginx.conf

And I have this error :

nginx: [alert] could not open error log file: open() "/root/logs/error.log" failed (2: No such file or directory)

2018/03/02 09:02:55 [emerg] 30824#0: open() "/root/conf/nginx.conf" failed (2: No such file or directory)

/////////////////UPDATE2//////////////:

[root@nexus-chat1 ~]# cd /root/
[root@nexus-chat1 ~]# ll
total 4
-rw-------. 1 root root 1512  1 mars  11:05 anaconda-ks.cfg
drwxr-xr-x. 3 root root   65  1 mars  11:36 openresty_compilation

Where do I need to create these folders ?

mkdir ~/work
cd ~/work
mkdir logs/ conf/

In /usr/local/openresty/ ?


Solution

  • Very likely nginx cannot open a log file because folder doesn't exists or permission issue.

    You can see the reason within error.log file