# Cant start Nginx on Mac OS X

**URL:** <https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068>\
**Category:** NGINX\
**Created:** [November 21, 2011, 4:24am UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068 "2011-11-21T04:24:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [November 21, 2011, 4:24am UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068/1 "2011-11-21T04:24:00Z")

</div>

Sorry for the newbie question. I am new to nginx. i installed it  
successfully on my mac, but when i try to start it, i get this error

nginx: [alert] could not open error log file: open()  
“/opt/local/var/log/nginx/error.log” failed (13: Permission denied)  
2011/11/20 22:15:20 [emerg] 1620#0: open()  
“/opt/local/etc/nginx/nginx.conf” failed (2: No such file or directory)

Can someone please help me resolve this? Thank you

Kofi

Posted at Nginx Forum:

> **[Cant start Nginx on Mac OS X](https://forum.nginx.org/read.php?2,218663,218663#msg-218663)**
>
> Sorry for the newbie question. I am new to nginx. i installed it successfully on my mac, but when i try to start it, i get this error nginx: \[alert\] could not open error log file: open() "/opt/local/var/log/nginx/error.log" failed (13:...

---

<div class="post-metadata">

**Author:** ![scriptonian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bb73d2/32.png) [@scriptonian](https://www.ruby-forum.com/u/scriptonian)\
**Post date:** [November 21, 2011, 4:26am UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068/2 "2011-11-21T04:26:28Z")

</div>

> > > Permission denied

## start nginx use root or sudo

blog: [http://chenxiaoyu.org](http://chenxiaoyu.org)

---

<div class="post-metadata">

**Author:** ![scriptonian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bb73d2/32.png) [@scriptonian](https://www.ruby-forum.com/u/scriptonian)\
**Post date:** [November 21, 2011, 5:34am UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068/3 "2011-11-21T05:34:54Z")

</div>

super!.. one error went away, now i am left with just one

nginx: [emerg] open() “/opt/local/etc/nginx/nginx.conf” failed (2: No  
such file or directory)

Any ideas why that is?

Posted at Nginx Forum:

> **[Re: Cant start Nginx on Mac OS X](https://forum.nginx.org/read.php?2,218663,218667#msg-218667)**
>
> Sorry for the newbie question. I am new to nginx. i installed it successfully on my mac, but when i try to start it, i get this error nginx: \[alert\] could not open error log file: open() "/opt/local/var/log/nginx/error.log" failed (13:...

---

<div class="post-metadata">

**Author:** ![scriptonian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bb73d2/32.png) [@scriptonian](https://www.ruby-forum.com/u/scriptonian)\
**Post date:** [November 21, 2011, 5:38am UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068/4 "2011-11-21T05:38:00Z")

</div>

On Mon, Nov 21, 2011 at 11:34 AM, scriptonian [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> super!.. one error went away, now i am left with just one
> 
> nginx: [emerg] open() “/opt/local/etc/nginx/nginx.conf” failed (2: No  
> such file or directory)
> 
> Any ideas why that is?

…missing config file?

–  
O\< ascii ribbon campaign - stop html mail - [www.asciiribbon.org](http://www.asciiribbon.org)

---

<div class="post-metadata">

**Author:** ![scriptonian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bb73d2/32.png) [@scriptonian](https://www.ruby-forum.com/u/scriptonian)\
**Post date:** [November 21, 2011, 5:54am UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068/5 "2011-11-21T05:54:01Z")

</div>

Reposting…

fastcgi.conf  
koi-win  
scgi\_params.example  
fastcgi.conf.example  
mime.types  
uwsgi\_params  
fastcgi\_params  
mime.types.example  
uwsgi\_params.example  
fastcgi\_params.example  
nginx.conf.example  
win-utf  
koi-utf  
scgi\_params

Posted at Nginx Forum:

> **[Re: Cant start Nginx on Mac OS X](https://forum.nginx.org/read.php?2,218663,218671#msg-218671)**
>
> Sorry for the newbie question. I am new to nginx. i installed it successfully on my mac, but when i try to start it, i get this error nginx: \[alert\] could not open error log file: open() "/opt/local/var/log/nginx/error.log" failed (13:...

---

<div class="post-metadata">

**Author:** ![scriptonian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bb73d2/32.png) [@scriptonian](https://www.ruby-forum.com/u/scriptonian)\
**Post date:** [November 21, 2011, 5:52am UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068/6 "2011-11-21T05:52:48Z")

</div>

Yes but why is it missing? 🙂

I installed the server ☹ … shouldn’t the installation put that file  
there during setup?

i see only these files in the /etc/nginx/ folder

fastcgi.conf koi-win scgi\_params.example  
fastcgi.conf.example mime.types uwsgi\_params  
fastcgi\_params mime.types.example uwsgi\_params.example  
fastcgi\_params.example nginx.conf.example win-utf  
koi-utf scgi\_params

Posted at Nginx Forum:

> **[Re: Cant start Nginx on Mac OS X](https://forum.nginx.org/read.php?2,218663,218670#msg-218670)**
>
> Sorry for the newbie question. I am new to nginx. i installed it successfully on my mac, but when i try to start it, i get this error nginx: \[alert\] could not open error log file: open() "/opt/local/var/log/nginx/error.log" failed (13:...

---

<div class="post-metadata">

**Author:** ![scriptonian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bb73d2/32.png) [@scriptonian](https://www.ruby-forum.com/u/scriptonian)\
**Post date:** [November 21, 2011, 5:56am UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068/7 "2011-11-21T05:56:29Z")

</div>

On Mon, Nov 21, 2011 at 11:52 AM, scriptonian [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Yes but why is it missing? 🙂
> 
> I installed the server ☹ … shouldn’t the installation put that file  
> there during setup?

Even if it did, you should edit the config anyway. The  
nginx.conf.example should help.

–  
O\< ascii ribbon campaign - stop html mail - [www.asciiribbon.org](http://www.asciiribbon.org)

---

<div class="post-metadata">

**Author:** ![scriptonian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bb73d2/32.png) [@scriptonian](https://www.ruby-forum.com/u/scriptonian)\
**Post date:** [November 21, 2011, 5:57am UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068/8 "2011-11-21T05:57:43Z")

</div>

在 2011-11-20日的 23:34 -0500，scriptonian写道：

> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

make sure that the path /opt/local/etc/nginx/ existed,and give it umask  
775.

also,do it under ROOT.

–  
Best regards,  
Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED** )

Using Gmail? Please read this important notice:  
[Gmail — Free Software Foundation — Working together for free software](http://www.fsf.org/campaigns/jstrap/gmail?10073).

---

<div class="post-metadata">

**Author:** ![scriptonian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bb73d2/32.png) [@scriptonian](https://www.ruby-forum.com/u/scriptonian)\
**Post date:** [November 21, 2011, 6:03pm UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068/9 "2011-11-21T18:03:59Z")

</div>

Thanks so much guys. I got all the errors to go away… however, when i  
start the server i get this

nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)  
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)  
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)  
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)  
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)  
nginx: [emerg] still could not bind()

looks like a port conflict to me. i dont know. but i dont have any other  
servers running. when i hit [http://localhost/](http://localhost/) 404 Not Found (  
nginx/1.0.8 )

Posted at Nginx Forum:

> **[Re: Cant start Nginx on Mac OS X](https://forum.nginx.org/read.php?2,218663,218713#msg-218713)**
>
> Sorry for the newbie question. I am new to nginx. i installed it successfully on my mac, but when i try to start it, i get this error nginx: \[alert\] could not open error log file: open() "/opt/local/var/log/nginx/error.log" failed (13:...

---

<div class="post-metadata">

**Author:** ![scriptonian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bb73d2/32.png) [@scriptonian](https://www.ruby-forum.com/u/scriptonian)\
**Post date:** [November 21, 2011, 6:05pm UTC](https://www.ruby-forum.com/t/cant-start-nginx-on-mac-os-x/214068/10 "2011-11-21T18:05:50Z")

</div>

and when i do

nginx -s stop

i can NOT even get a 404 error page. so something is working right at  
least. but i still have a blocker.

Posted at Nginx Forum:

> **[Re: Cant start Nginx on Mac OS X](https://forum.nginx.org/read.php?2,218663,218714#msg-218714)**
>
> Sorry for the newbie question. I am new to nginx. i installed it successfully on my mac, but when i try to start it, i get this error nginx: \[alert\] could not open error log file: open() "/opt/local/var/log/nginx/error.log" failed (13:...
