解决nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
来源:互联网 发布:维生素c 知乎 编辑:程序博客网 时间:2024/06/05 00:19
今天在ubuntu10.04上面安装nginx,安装完成之后尝试启动nginx,使用命令:
- sudo /etc/init.d/nginx start
结果提示错误:
- hankcs@ubuntu:~$ sudo /etc/init.d/nginx start
- [sudo] password for hankcs:
- * Starting nginx nginx nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- nginx: [emerg] still could not bind()
我看了一下端口占用情况,并且尝试杀了进程:
- hankcs@ubuntu:~$ netstat -ntpl
- (并非所有进程都能被检测到,所有非本用户的进程信息将不会显示,如果想看到所有信息,则必须切换到 root 用户)
- 激活Internet连接 (仅服务器)
- Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
- tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN -
- tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
- hankcs@ubuntu:~$ killall -9 nginx
- nginx:没有发现操作
遇到这种问题我先用中文搜索了一下答案,发现大家都在装逼地说要杀nginx重复的进程。我试了下发现是扯淡,于是看了谷歌搜到的第一个英文页面,老外说是nginx先监听了ipv4的80端口之后又监听了ipv6的80端口,于是就重复占用了。更加坑人的是你去看了端口占用它又把80端口释放了,是不是很囧。
解决方案是编辑nginx的配置文件
- hankcs@ubuntu:~$ sudo gedit /etc/nginx/sites-available/default
修改这一段:
- listen 80;
- listen [::]:80 default_server;
为
- listen 80;
- listen [::]:80 ipv6only=on default_server;
然后启动nginx,完美解决!
阅读全文
0 0
- nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 错误解决
- 解决nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 错误解决
- nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 错误解决
- nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)问题的解决
- 解决nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- 解决nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- nginx错误之 nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
- Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
- Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
- Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
- nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
- Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
- nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
- 关于nginx启动失败 [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
- Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
- nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 解决办法
- JDBC应用实例
- 自学git 常用git(一)
- 如何在 Azure 中的经典 Windows 虚拟机上设置终结点
- 商品列表页面(模板)
- Leetcode题解-24. Swap Nodes in Pairs
- 解决nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- 283. Move Zeroes
- Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.google.android.webview-2/li
- Linux安装配置memcached
- centos7开机后进入命令行模式
- CNN入门paper
- python 基础
- select2下拉搜索框匹配汉字全拼及首字母
- Oracle实现自动删除大数据量表7天前的数据