[Case 99137] Address already in use: make_sock: could not bind to address

sreeninair

Well-Known Member
Dec 23, 2013
100
0
16
cPanel Access Level
Root Administrator
Hello Guys,

I am getting the following error in my apache log and the service is not getting started. I have to remove the following entries in http.conf to make it working. After some time it reappears and httpd fails again. Please assist me on this.


===============
apache conf entries

Listen [::]:443
Listen [::]80

after removing these entries apache starts working.


===============
apache error log:
[Mon Feb 17 13:01:33 2014] [notice] Graceful restart requested, doing restart
(98)Address already in use: make_sock: could not bind to address [::]:443
no listening sockets available, shutting down
Unable to open logs
================
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Hello :)

Changes made to the httpd.conf file through manual edits are not preserved unless you use the distiller. However, the following entries are normal and should exist:

Code:
Listen 0.0.0.0:80
Listen [::]:80
Listen 0.0.0.0:443
Listen [::]:443
Do you notice duplicate entries, or do you have any other service already running on these ports?

Thank you.
 

2kreative

Registered
Jul 22, 2005
1
0
151
I have the exact same problem!
Removing
Listen [::]:80
Listen [::]:443 allows apache to start, otherwise I get the address already in use.

This happened after I ran
/scripts/buildhttpdconf

Any ideas?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Do you have any reserved IP addresses in "WHM >> Service Configuration >> Apache Configuration >> Reserved IPs"? Also, what version of cPanel is installed on your system?

Thank you.
 
D

Deleted member 26294

Guest
The same happened on a server of mine after tonight's cpanel update. Update went okay, but apache failed to start afterwards. The apache log contained "long lost child came home!". After removing

Listen 0.0.0.0:80
Listen [::]:80

Apache started again and everything seems to "work". I'm going to try rebuilding apache this weekend, but obviously something went wrong after this update...
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Could you review my last post and let us know if that applies in your case?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Please open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

unity200

Member
Nov 16, 2006
21
3
153
I dont want to divulge root access to server.

I commented out Listen [::]:80 and Listen [::]:443 and apache restarted.
 
D

Deleted member 26294

Guest
Hi Michael, I'm running the latest current build - 11.42.1.11. And yes, I do have some reserved IP addresses.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
It's likely that IPv6 is enabled, and it's been a while since EasyApache was ran, so a patch that addresses the issue has not been applied. Are you able to rebuild Apache via EasyApache and let us know if the issue persists?

Thank you.
 
D

Deleted member 26294

Guest
Ok, I tracked down the problem. I tried rebuilding apache last night and it failed to start up again. So I went through the include files and sure enough, there was a Listen [::]:80 directive in one of them - I enabled IPV6 awhile back and added that directive into the include file and completely forgot about it. After I removed that line, I was able to rebuild apache and it starts successfully.

Odd thing is, I've definitely run EA numerous times on this system since I enabled IPV6 (to update PHP) and I've never had an issue with the process failing. Maybe because apache itself wasn't being upgraded those times?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
The custom entry you added could have been interfering with the configuration that cPanel now uses automatically.

Thank you.
 

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,740
300
363
Chesapeake, VA
cPanel Access Level
DataCenter Provider
Saw this on a server today. We do have a reserved IP, but IPv6 is not enabled. Can't re-run easyapache because this server is still running php 5.2 and the operators are not ready to update that to 5.3.

I manually edited out the listen lines as described, but am hoping for another more reliable fix.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Saw this on a server today. We do have a reserved IP, but IPv6 is not enabled. Can't re-run easyapache because this server is still running php 5.2 and the operators are not ready to update that to 5.3.

I manually edited out the listen lines as described, but am hoping for another more reliable fix.
The recommended solution to this issue is run EasyApache. Note that PHP 5.2 is available as a custom module here:

EasyApache - Custom Modules

Thank you.
 

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,740
300
363
Chesapeake, VA
cPanel Access Level
DataCenter Provider
The recommended solution to this issue is run EasyApache. Note that PHP 5.2 is available as a custom module here:

EasyApache - Custom Modules

Thank you.
I used that once but it was missing some options. As I understand it you cannot select any of the options on the exhaustive list.

Anything else that can be done?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
I used that once but it was missing some options. As I understand it you cannot select any of the options on the exhaustive list. Anything else that can be done?
1. You could try using raw opts to include additional modules with PHP.

EasyApache - Raw Opts

However, note that it's not supported so it's not guaranteed to work without conflicts.

2. We do have an internal case open (#99137) to explore alternatives to resolving this issue without utilizing EasyApache. There is currently no time frame available on such a solution, but I will monitor the case and update this thread with the outcome.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
A resolution for internal case 99137 is now scheduled for a future build of cPanel. The fix will add a check to ensure the IPv6 "Listen" directives are populated only when the httpd options support it (IPv4-mapped addresses is disabled). You can monitor our change logs for this case number.

Thank you.
 

elmister

Active Member
Mar 2, 2004
35
1
158
Same problem here, server without IPv6 configuration, after some apache restart it doesn't come up

httpd.conf contains the line
Listen [::]80

no reason for that line to be there, this server is not IPv6 enabled.

I'm afraid that hundreds of servers without IPv6 may have this line added and apache crashed.

Even if i remove the lines, everytime httpd.conf is rebuilt the lines are added again and the server goes down.

We can't prevent users from adding domains or subdomains and that would cause httpd.conf to be rebuilt
 
Last edited:

zye

Well-Known Member
Dec 6, 2002
117
4
168
Re: [Case 80445] Apache Fails - Address already in use

same issue just happend again after /usr/local/cpanel/scripts/upcp --cron

how can i prevent this in the future?