UJP - nginxのエラーログに[emerg] : bind() to 0.0.0.0:80 failed (13: Permission denied)とでちゃう

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

  • カテゴリ MacBook Pro の最新配信
  • RSS
  • RDF
  • ATOM

ブログ - nginxのエラーログに[emerg] : bind() to 0.0.0.0:80 failed (13: Permission denied)とでちゃう

nginxのエラーログに[emerg] : bind() to 0.0.0.0:80 failed (13: Permission denied)とでちゃう

カテゴリ : 
Apple » MacBook Pro » 2011 13inch
ブロガー : 
ujpblog 2017/11/29 1:32
 Home Brewでインストールしたnginxは,8080ポートでリッスンしているが,80番に変更する.イメージ的にはこんな感じ.


 編集するのは,このファイル.
/usr/local/etc/nginx/nginx.conf
 みて分かる通り,次のように変更,.
    server {
#        listen       8080;
        listen       80;
        server_name  localhost;

 そしてnginxを停止して起動.
gaia:nginx server$ brew services stop nginx
Stopping `nginx`... (might take a while)
==> Successfully stopped `nginx` (label: homebrew.mxcl.nginx)
gaia:nginx server$ brew services start nginx
==> Successfully started `nginx` (label: homebrew.mxcl.nginx)
gaia:nginx server$

http://localhost:80

 アクセスできない.エラーログを確認.
tail -f /usr/local/Cellar/nginx/1.12.2_1/logs/error.log
 これをみると・・・
2017/11/29 01:22:05 [emerg] 19863#0: bind() to 0.0.0.0:80 failed (13: Permission denied)
2017/11/29 01:22:05 [emerg] 19863#0: bind() to 0.0.0.0:80 failed (13: Permission denied)
2017/11/29 01:22:05 [emerg] 19863#0: bind() to 0.0.0.0:80 failed (13: Permission denied)
 これは,80番ポートを割り当て(bind)起動しようとしたが権限が無いのでエラーとなっている.sudoで起動してみる.

gaia:nginx server$ sudo brew services start nginx
Password:
==> Successfully started `nginx` (label: homebrew.mxcl.nginx)
gaia:nginx server$ 
 再度,これをアクセス.

http://localhost:80

 問題なし.

トラックバック


広告スペース
Google