Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(48)Address already in use: make_sock: could not bind to address [::]:80 on OS x Mavericks

I just updated my OSX yesterday with Mavericks and now I am getting error while using apache and Jetty. It used to map my example.com domain directly to the localhost.

Now It seems broke on do to run my application server I have to explicitly specifying port to hit my server.(ex. example.com:8080)

While I run below command.

 sudo apachectl -e debug

I will get the

 [debug] mod_so.c(246): loaded module jk_module
(48)Address already in use: make_sock: could not bind to address [::]:80
(48)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down

I ran many diff command to kill all httpd process as well find port which is listening on this port.

ex. sudo lsof -i :80

httpd      946          root    5u  IPv6 0xe0c8ad50898bcf0f      0t0  TCP *:http (LISTEN)
httpd      947          _www    5u  IPv6 0xe0c8ad50898bcf0f      0t0  TCP *:http (LISTEN)
httpd      949          _www    5u  IPv6 0xe0c8ad50898bcf0f      0t0  TCP *:http (LISTEN)
httpd      954          _www    5u  IPv6 0xe0c8ad50898bcf0f      0t0  TCP *:http (LISTEN)
Google    1633 jignesh.sheth   59u  IPv4 0xe0c8ad508597efaf      0t0  TCP example.com:53742->stackoverflow.com:http (ESTABLISHED)
Google    1633 jignesh.sheth  189u  IPv4 0xe0c8ad5082027faf      0t0  TCP example.com:53725->stackoverflow.com:http (ESTABLISHED)

Any idea what am I doing wrong?

like image 388
Jignesh Sheth Avatar asked Oct 24 '13 20:10

Jignesh Sheth


2 Answers

I also had the same, I removed 'Listern 80' from my config file to solve this issue.

like image 128
Sakkeer Hussain Avatar answered Nov 14 '22 16:11

Sakkeer Hussain


I had the same error. The error log file for Apache server at /var/log/apache*/ mentioned "Address already in use: make_sock: could not bind to address 0.0.0.0:443". Resolved it using "sudo lsof -i :" command to find processes running on port. Kill all the processes and re-run sudo apachectl start. The apache server should start running.

This may help: https://superuser.com/questions/479146/macports-apache2-could-not-bind-to-address/479147#479147?newreg=95099c6a74724da49640329d4ee400f2

like image 40
shweta Avatar answered Nov 14 '22 16:11

shweta