首頁  >  問答  >  主體

windows10 - Windows 10 安裝 nginx 出錯

logs bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)

這裡發現是因為 system佔用80埠、system為系統流程,又不能關閉,要怎麼解決呢?我測試了一下 win7是好的。大家平常是怎麼解決的呢?

接上面,配置出現問題,test.conf copy 一份nginx.conf,配置如下, 為什麼請求www.hht.com(這裡我在host裡配置過了),為什麼還是80端口,配置裡面的連接埠是32000,

#這又是什麼原因呢?

test.conf


#user  nobody;
worker_processes  1;

error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       32000;
        server_name  www.hht.com;
        charset utf-8;
        location / {
            root   deployed;
            index  index.html index.htm;
        }

        error_page  404              /404.html;
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
    server {
        listen       192.168.0.102:33000;
        server_name  www.hhh.com;
        charset utf-8;
        access_log  logs/host.access.log  main;
        location / {
            root   html;
            index  index.html index.htm;
        }
        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }



}


####
迷茫迷茫2714 天前567

全部回覆(4)我來回復

  • 世界只因有你

    世界只因有你2017-05-16 17:14:58

    1.system那個佔用80端口的應用或許可以使用net stop servicename關閉
    2.給nginx使用另外一個端口先跑起來再來其他方面的問題(抓住重點)

    回覆
    0
  • PHP中文网

    PHP中文网2017-05-16 17:14:58

    檢查 IIS 或 IIS Express。

    回覆
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 17:14:58

    一樓已經說的很清楚了,不過強烈建議在linux上面玩,別問我怎麼知道的,都是走過的坑啊。 。 。

    回覆
    0
  • ringa_lee

    ringa_lee2017-05-16 17:14:58

    1. 綁在其他連接埠

    2. 排查埠佔用

    3. 使用Docker :)

    回覆
    0
  • 取消回覆