# Disable default error\_log?

**URL:** <https://www.ruby-forum.com/t/disable-default-error-log/219650>\
**Category:** NGINX\
**Created:** [May 10, 2012, 10:08am UTC](https://www.ruby-forum.com/t/disable-default-error-log/219650 "2012-05-10T10:08:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [May 10, 2012, 10:08am UTC](https://www.ruby-forum.com/t/disable-default-error-log/219650/1 "2012-05-10T10:08:32Z")

</div>

Hi,

It seems something in nginx has changed: I can no longer run it in  
isolation as a user. Even if I disable or move all log files to a  
place the user has control over, nginx will still try to open  
“/var/log/nginx/error.log”. Is this path hard-coded, or is it possible  
to change it?

This the output I get when trying to run nginx with a custom  
configuration file:

$ nginx -g ‘error\_log /dev/null crit;’ -q -c mynginx.conf  
nginx: [alert] could not open error log file: open()  
“/var/log/nginx/error.log” failed (13: Permission denied)

–  
Johan B.

---

<div class="post-metadata">

**Author:** ![mrcoffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@mrcoffe](https://www.ruby-forum.com/u/mrcoffe)\
**Post date:** [May 12, 2012, 1:06am UTC](https://www.ruby-forum.com/t/disable-default-error-log/219650/2 "2012-05-12T01:06:46Z")

</div>

On 10 May 2012 09:07, Johan B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> $ nginx -g ‘error\_log /dev/null crit;’ -q -c mynginx.conf  
> nginx: [alert] could not open error log file: open()  
> “/var/log/nginx/error.log” failed (13: Permission denied)

[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/NginxMainModule#error_log) seems to suggest that  
you’ll have this problem since 0.7.53. Does that fit in with the  
timeline of your “something […] has changed”, above?

If so, “known issue”.

If not, something else may have changed - perhaps the order in which  
the -g/-c parameters are examined (a complete guess, of course) - and  
you should continue shouting about it 🙂

## J

Jonathan M.  
Oxford, London, UK

> **[Jonathan Matthews :: Words Typed, Great Rates For Cash](https://www.jpluscplusm.com)**

---

<div class="post-metadata">

**Author:** ![mrcoffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@mrcoffe](https://www.ruby-forum.com/u/mrcoffe)\
**Post date:** [May 14, 2012, 4:59pm UTC](https://www.ruby-forum.com/t/disable-default-error-log/219650/3 "2012-05-14T16:59:55Z")

</div>

On Sat, May 12, 2012 at 1:06 AM, Jonathan M.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/NginxMainModule#error_log) seems to suggest that  
> you’ll have this problem since 0.7.53. Does that fit in with the  
> timeline of your “something […] has changed”, above?
> 
> If so, “known issue”.

Hmm, I’ve gone through my apt logs (debian), and this is what I get:  
0. nginx is installed

1. upgrade: 1.1.17-2 → 1.1.18-1
2. upgrade: 1.1.18-1 → 1.1.19-1

I cannot see any trace of an nginx older than 1.1.17-2, which I’m  
guessing is newer than 0.7.53.  
So either I’ve had an old install of nginx which did not use the  
package system, or this problem did not exist with one of the versions  
listed.

I can try downgrading and see if it changes anything or not.

–  
Johan B.

---

<div class="post-metadata">

**Author:** ![mrcoffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@mrcoffe](https://www.ruby-forum.com/u/mrcoffe)\
**Post date:** [May 15, 2012, 2:54pm UTC](https://www.ruby-forum.com/t/disable-default-error-log/219650/4 "2012-05-15T14:54:57Z")

</div>

On Tue, May 15, 2012 at 1:51 PM, Jonathan M.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 14 May 2012 15:58, Johan B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I can try downgrading and see if it changes anything or not.
> 
> Since nginx is a single binary, I suggest you might be able to extract  
> the binary from the old package and have both on the system in  
> parallel. This would let you give us the output from 2 versioned runs.  
> Kind of like

Alright, so I checked out the SVN repo and built the earlier versions.  
No change. I tried 1.1.15-1.2.0 and every version gave the error.

I must have somehow upgraded from a 0.\* version without my package  
manager noticing it. Strange.

–  
Johan B.

---

<div class="post-metadata">

**Author:** ![mrcoffe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@mrcoffe](https://www.ruby-forum.com/u/mrcoffe)\
**Post date:** [May 15, 2012, 1:52pm UTC](https://www.ruby-forum.com/t/disable-default-error-log/219650/5 "2012-05-15T13:52:50Z")

</div>

On 14 May 2012 15:58, Johan B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I can try downgrading and see if it changes anything or not.

Since nginx is a single binary, I suggest you might be able to extract  
the binary from the old package and have both on the system in  
parallel. This would let you give us the output from 2 versioned runs.  
Kind of like

```
user@austin:~$ nginx-1.1.18 -g "blah"
nginx: [alert] could not open error log file: open()
"/var/log/nginx/error.log" failed (13: Permission denied)
2012/05/15 12:48:49 [emerg] 25887#0: unexpected end of parameter,
expecting ";" in command line
user@austin:~$ nginx-1.1.17 -g "blah"
[... nginx is running fine]
```

With some -V invocations in there to show the compile-time settings,  
too.

## HTH, Jonathan

Jonathan M.  
Oxford, London, UK

> **[Jonathan Matthews :: Words Typed, Great Rates For Cash](https://www.jpluscplusm.com)**
