You shouldn't be creating the pid file yourself. As you said, it will contain the process identifier and is used by the service tool to start/stop/restart/status/... the nginx process.
Try removing the line 'user: www www;' which should cause nginx to run root (provided you're starting it with sudo /usr/local/nginx/sbin/nginx) Set the pid line to: pid /usr/local/nginx/nginx.pid It doesn't really matter where it is stored, as long as it's in a directory that exists. Regards, Simon On 14 May 2013, at 17:56, Samuel Gutiérrez Jiménez-Peña <samuelgutierrezjime...@gmail.com> wrote: > Hi Simon, > > I understand that what is wrong is that nginx.pid file does not exist in the > /usr/local/logs/. I created this empty file (nginx.pid), but I get another > error: nginx: [error] PID invalid number "" in "/ usr / local / nginx / logs > / nginx.pid" > > I think that within nginx.pid, shall enter or contain the identifiers of the > processes. > > <Captura de pantalla 2013-05-14 a la(s) 18.46.29.png> > > Currently I'm installing on MacOSX, which would leave the location as it is: > pid /logs/nginx.pid; > > Another question is whether the line: user 'www' 'www'; it's correct? because > I haven't that user and don't know if it is best to remove that line. > > Thanks in advance. > > Regards, Samuel. > > El 14/05/2013, a las 16:52, Simon Gaeremynck <gaeremyn...@gmail.com> escribió: > >> That's probably coming from the statement: >> >> pid logs/nginx.pid; >> >> That line tells nginx that it should store a pid file (a file with the >> process id) at logs/nginx.pid relative against your nginx.conf file. >> >> So either the directory /usr/local/nginx/logs doesn't exist/www user has no >> write-rights to and you should create/chown it OR you should change that >> line to something else. >> >> If you're running on some kind of flavor of Linux, /var/run is usually a >> good place to store them. >> so: >> pid /var/run/nginx.pid >> >> >> Regards, >> >> Simon >> >> >> On 14 May 2013, at 13:37, Samuel Gutiérrez Jiménez-Peña >> <samuelgutierrezjime...@gmail.com> wrote: >> >>> Hi Simon, >>> >>> I reviewed your file and it has been very useful. The changes I made are: >>> >>> user 'www' 'www'; >>> >>> and place all alias correctly that gave errors. >>> >>> But I can't run properly, because it warns: nginx: [error] open () "/ usr / >>> local / nginx / logs / nginx.pid" failed (2: No such file or directory) >>> >>> I've checked whether the file exists and clearly, is not in that directory. >>> Where could I download the file? >>> >>> I'm attaching again, the nginx.conf file, in case I had to put something >>> wrong: >>> <nginx.conf> >>> >>> Forgive all the inconvenience caused. >>> >>> Regards, Samuel. >>> >>> >>> El 14/05/2013, a las 13:36, Simon Gaeremynck <gaeremyn...@gmail.com> >>> escribió: >>> >>>> Hey Samuel, >>>> >>>> You'll need to completely replace anything between <%= .. => signs. >>>> For example, I have my 3akai-ux repository at >>>> /opt/sakai/oae/repos/3akai-ux so the line >>>> alias <%= nginxConf.UX_HOME %>/admin/; >>>> would become: >>>> alias /opt/sakai/oae/repos/3akai-ux/admin/; >>>> >>>> You can find my full config at [1], it might contain some dev stuff but it >>>> should give you an idea of how an nginx config looks like. >>>> >>>> Hope that helps, >>>> >>>> Simon >>>> >>>> [1] http://pastebin.com/hm5iFkgS >>>> >>>> On 14 May 2013, at 12:19, Samuel Gutiérrez Jiménez-Peña >>>> <samuelgutierrezjime...@gmail.com> wrote: >>>> >>>>> Hi Simon, >>>>> >>>>> The error still persists when change, NGINX_USER: www and NGINX_GROUP: >>>>> www, I keep getting: nginx: [emerg] invalid number of arguments in "user" >>>>> directive in / usr / local / nginx / conf / nginx.conf: 1 >>>>> >>>>> I've also tried to delete the line corresponding to user and get the >>>>> following error: nginx: [emerg] unknown directive "admin.oae.com" in / >>>>> usr / local / nginx / conf / nginx.conf: 32 >>>>> >>>>> I don't know really where the error may be, I would be very useful if you >>>>> could send me a sample of how it would set, the nginx.conf >>>>> >>>>> I send you, my file nginxconf as what I've configured: >>>>> <nginx.conf> >>>>> >>>>> Thanks in advance. >>>>> >>>>> Regards, Samuel. >>>>> >>>>> El 14/05/2013, a las 09:12, Simon Gaeremynck <gaeremyn...@gmail.com> >>>>> escribió: >>>>> >>>>>> Hey Samuel, >>>>>> >>>>>> Those should be the user and group you're running nginx under. >>>>>> Typically this might be 'www' and 'www'. I think however that it's >>>>>> possible to remove this line and nginx will take the appropriate >>>>>> user/group. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Simon >>>>>> >>>>>> On 13 May 2013, at 21:17, Samuel Gutiérrez Jiménez-Peña >>>>>> <samuelgutierrezjime...@gmail.com> wrote: >>>>>> >>>>>>> Hi all, >>>>>>> >>>>>>> I have a doubt regarding the manual to install the new version of Sakai >>>>>>> OAE Hilary. >>>>>>> >>>>>>> I've followed all the steps of: >>>>>>> https://github.com/sakaiproject/Hilary/blob/master/README.md >>>>>>> >>>>>>> But to configure the nginx.cnf, I've encountered a problem. By putting >>>>>>> the command: sudo /usr/local/nginx/sbin/nginx -s reload >>>>>>> >>>>>>> I jump with the following error: nginx: [emerg] invalid number of >>>>>>> arguments in "user" directive in /usr/local/nginx/conf/nginx.conf:1 >>>>>>> >>>>>>> My question is about the parameters <% = NGINX_USER%> and <% = >>>>>>> NGINX_GROUP%>, which I don't know which substitute values. >>>>>>> >>>>>>> user <%= nginxConf.NGINX_USER %> <%= >>>>>>> nginxConf.NGINX_GROUP %>; >>>>>>> >>>>>>> I hope your answers. >>>>>>> >>>>>>> Regards, Samuel. >>>>>>> _______________________________________________ >>>>>>> oae-dev mailing list >>>>>>> oae-dev@collab.sakaiproject.org >>>>>>> http://collab.sakaiproject.org/mailman/listinfo/oae-dev >>>>>> >>>>> >>>> >>> >> > _______________________________________________ oae-dev mailing list oae-dev@collab.sakaiproject.org http://collab.sakaiproject.org/mailman/listinfo/oae-dev