全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 18987|回复: 10
打印 上一主题 下一主题

[nginx] 还是nginx问题[emerg]: bind() to 0.0.0.0:80 failed

[复制链接]
跳转到指定楼层
1#
发表于 2009-12-25 17:23:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
nginx无法启动
[root@vps ~]# /usr/local/nginx/sbin/nginx
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()
2#
发表于 2009-12-25 17:30:11 | 只看该作者
楼主有多个IP.有钱人哪.哈哈

绑定虚拟主机的时候指定IP和端口.
如: 127.0.0.1:80
3#
发表于 2009-12-25 17:56:34 | 只看该作者
原帖由 wian1314 于 2009-12-25 17:23 发表
nginx无法启动
[root@vps ~]# /usr/local/nginx/sbin/nginx
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bin ...


查看ifconfig,看看是不是VPS的hostname綁到裡面了,如果這裡面綁了的話,你再綁到nginx裡,就會出現被佔用的錯誤!
修改hostname名稱即可解決!
4#
 楼主| 发表于 2009-12-25 17:57:56 | 只看该作者
那里的问题
user  www www;

worker_processes 1;

error_log  /home/www/logs/nginx_error.log  crit;

pid        /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
        {
                use epoll;
                worker_connections 51200;
        }

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

                #charse  gb2312;

                server_names_hash_bucket_size 128;
                client_header_buffer_size 32k;
                large_client_header_buffers 4 32k;
                client_max_body_size 8m;

                sendfile on;
                tcp_nopush     on;

                keepalive_timeout 60;

                tcp_nodelay on;

                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 4 64k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 128k;

                gzip on;
                gzip_min_length  1k;
                gzip_buffers     4 16k;
                gzip_http_version 1.0;
                gzip_comp_level 2;
                gzip_types       text/plain application/x-javascript text/css application/xml;
                gzip_vary on;

                #limit_zone  crawler  $binary_remote_addr  10m;

server
        {
                listen       80;
                server_name www.dddxxx.com;
                index index.html index.htm index.php;
                root  /home/www;

                #limit_conn   crawler  20;

                #location /status {
                #stub_status        on;
                #access_log        off;
                #}

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                #fastcgi_pass  127.0.0.1:9000;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log  /home/www/logs/access.log  access;
        }

server
        {
                listen  81;
                server_name  status.lnmp.org;

                location / {
                        stub_status on;
                        access_log   off;
                }
        }
}
5#
发表于 2009-12-25 18:03:54 | 只看该作者
80端口已经在使用了,看看是不是apache等其他的webserver在用80。
6#
发表于 2009-12-25 18:13:31 | 只看该作者
楼上正解, ps -aux看看什么webserver在跑
7#
发表于 2009-12-25 18:15:47 | 只看该作者
端口 已被使用
8#
发表于 2009-12-25 18:17:06 | 只看该作者
原帖由 dawnh 于 2009-12-25 18:13 发表
楼上正解, ps -aux看看什么webserver在跑


netstat -anp
这样不是更好
9#
 楼主| 发表于 2009-12-25 18:36:56 | 只看该作者
恩,.搞定.,TKS
10#
发表于 2009-12-25 18:41:54 | 只看该作者
我IP少。。。不用这个
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-7 16:15 , Processed in 0.111250 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表