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

3

8

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?

Three answered 24/10, 2013 at 20:37 Comment(0)
I
4

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

Imprinting answered 9/2, 2016 at 13:29 Comment(1)
After a system update, I had the same issue. I removed Listen 80 from httpd.conf and the problem resolved. (I would really like to know why)Indices
H
3

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

Humo answered 4/2, 2016 at 20:40 Comment(0)
A
2

I had the same problem.

What I did was changing the permission on "username.conf" from users directory to 644 like in this tutorial

http://www.coolestguidesontheplanet.com/downtown/get-apache-mysql-php-and-phpmyadmin-working-osx-109-mavericks

Ardie answered 27/10, 2013 at 20:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.