48)Address already in use: AH00072: make_sock: could not bind to address [::]:80

孤人 提交于 2019-12-20 12:35:43

问题


I get a apache error when I try access to anything folder or file, it returns Http Not found or Forbidden I am trying restart and start apache

sudo apachectl restart

output:

(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

I am trying stop it

sudo apachectl stop

output

httpd (no pid file) not running

I run sudo lsof -i:80

output:

COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME

    httpd    8904 root    5u  IPv6 0x21884d81f1597d8f      0t0  TCP *:http (LISTEN)
    httpd    9012 _www    5u  IPv6 0x21884d81f1597d8f      0t0  TCP *:http (LISTEN)
    httpd   12726 _www    5u  IPv6 0x21884d81f1597d8f      0t0  TCP *:http (LISTEN)
    httpd   12731 _www    5u  IPv6 0x21884d81f1597d8f      0t0  TCP *:http (LISTEN)
    httpd   12732 _www    5u  IPv6 0x21884d81f1597d8f      0t0  TCP *:http (LISTEN)

Any idea to solve that ?

Useful information:

OS X El Capitan

回答1:


In my Mac with Mojave (10.14.1) suddenly Apache couldn't give to serve ipv4 anymore, then gave me ERROR 403. I tried to kill all apache (sudo killall httpd)... checking de PID's on (sudo lsof | grep AMP | grep apache)... even didn't work... just ipv6 was available... still ERROR 403.

What works for me: Disable OSX's built-in Apache server.

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

After that:

sudo apachectl -k restart

Be happy :)




回答2:


One of a couple of things could be happening:

  1. You have a different version of apache running. You can make sure that you're using the correct one by running which apachectl. As an example, I also have two versions of apache /usr/sbin/apachectl and /usr/local/bin/apachectl
  2. You're not running apachectl start as root, although it appears that you are.
  3. You can run sudo lsof -i:80 to see what's binding that port currently



回答3:


Try

sudo netstat -ltnp | grep ':80'

Output: tcp6 0 0 :::80 :::* LISTEN 1500/apache2

sudo kill 1500
sudo service apache2 restart


来源:https://stackoverflow.com/questions/51047700/48address-already-in-use-ah00072-make-sock-could-not-bind-to-address-80

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!