windows10 - Windows 10 安装 nginx 出错
迷茫
迷茫 2017-05-16 17:12:58
0
4
559

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;
        }

    }



}



迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

全部回复(4)
世界只因有你

1.system那个占用80端口的应用或许可以使用net stop servicename关闭
2.给nginx使用另外一个端口先跑起来再来其他方面的问题(抓住重点)

洪涛

检查 IIS 或 IIS Express。

给我你的怀抱

一楼已经说的很清楚了,不过强烈建议在linux上面玩,别问我怎么知道的,都是走过的坑啊。。。

左手右手慢动作
  1. 绑在其他端口

  2. 排查端口占用

  3. 使用Docker :)

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!