nginx: [emerg] bind() to 0.0.0.0:80 failed (10013 ,解决无法绑定80端口,80被占用

nginx报错:

nginx: [emerg] 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)

原因:nginx启动端口默认是80端口,出现这个错误,多半是80端口已经被占用。

解决:在nginx的安装目录下的bin目录下找到  nginx.conf 文件,在文件中修改  listen  对应的端口号,此处改为了81。

    server {
        listen       81;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

你可能感兴趣的:(nginx)