Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 851
jjoselon Avatar asked Jun 26 '18 16:06

jjoselon


2 Answers

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 :)

like image 55
LuizEduardoMPF Avatar answered Sep 17 '22 11:09

LuizEduardoMPF


This one helped me:

Please edit httpd.conf file.

/usr/local/etc/httpd/httpd.conf

And replace

Listen 80

with

Listen 127.0.0.1:80

Restart apache

sudo apachectl -k restart
like image 39
Nuzil Avatar answered Sep 19 '22 11:09

Nuzil