[Case 80445] Apache Fails - Address already in use

zye

Well-Known Member
Dec 6, 2002
123
4
168
since around 3 days i have apache failing @ random times

error_log

[notice] Graceful restart requested, doing restart
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs

the i have to edit /etc/httpd/conf/httpd.conf

and comment out

# Listen 0.0.0.0:80
# Listen 0.0.0.0:443

in order to get it working again.

i really need help to sort that out.


logfile entries:

egrep make_sock: error_log
(98)Address already in use: make_sock: could not bind to address [::]:443
(98)Address already in use: make_sock: could not bind to address [::]:443
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443


and another pronblem just came up on another server i am using

i am not able to copy accounts from 1 server to another - the password is CORRECT

getting error

sshcmdpermissiondeny

sorted that out using ssh keys....
frustrated greets
 
Last edited:

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
833
28
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
You shouldn't need to comment out the Listen lines in httpd.conf. Can you paste the last 30 from your Apache error_log from before the make_sock errors. You can exclude any identifying information such as domains and paths.

For the account copy issue, you should open this as a separate post since it's a separate problem. From first glance, I would assume that either you're logging in as the wrong user, or the server being copied FROM does not accept passwords as a means of authentication over SSH. In that case, WHM will allow you to use a key instead.
 

zye

Well-Known Member
Dec 6, 2002
123
4
168
You shouldn't need to comment out the Listen lines in httpd.conf. Can you paste the last 30 from your Apache error_log from before the make_sock errors. You can exclude any identifying information such as domains and paths.

For the account copy issue, you should open this as a separate post since it's a separate problem. From first glance, I would assume that either you're logging in as the wrong user, or the server being copied FROM does not accept passwords as a means of authentication over SSH. In that case, WHM will allow you to use a key instead.
solved by support ticket



Hello,

This issue was related to our internal case #80445, where apache will try to bind to ports that it's already bound to itself due to an IPv6 Listen directive. To resolve this error you will need to create an local copy of the apache template and then make the following changes. In the following example we are assuming that apache 2.4 is installed however is you are running apache 2.2 you will just need to change the paths slightly (replacing 2_4 with 2_2).

The directory for apache 2.4: /var/cpanel/templates/apache2_4
The directory for apache 2.2: /var/cpanel/templates/apache2_2

The first thing needed is to make an local copy of the template. This makes sure that the default remains in place in the event that you wish to revert the changes by removing the local copy.

Apache 2.4
cp -v /var/cpanel/templates/apache2_4/main.{default,local}

Apache 2.2
cp -v /var/cpanel/templates/apache2_2/main.{default,local}

Now that the local copy has been made we can edit the local copy. When editing the local copy please make the following changes:

Replace this:

[% IF configured.ip_listen -%]
[%- FOREACH ip IN configured.ip_listen -%]
Listen [% ip %]:[% configured.main_port %]
[% END -%]
[% ELSE -%]
# Defined in /var/cpanel/cpanel.config: apache_port
Listen [% main.listen.item.listen %]
[% END -%]
with this:

Listen 80

and replace this:

[% IF configured.ip_listen_ssl -%]
[%- FOREACH ip IN configured.ip_listen_ssl -%]
Listen [% ip %]:[% configured.main_port_ssl %]
[% END -%]
[% ELSE -%]
# Defined in /var/cpanel/cpanel.config: apache_ssl_port
Listen [% main.ifdefinessl.listen.item.listen %]
[% END -%]
with this:

Listen 443

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now you will be able to run /scripts/rebuildhttpdconf to rebuild the apache configuration with the above updates and restart apache to resolve the issue:

# rebuildhttpdconf
# service httpd restart

Can you please verify that your issue has been resolved? If you issue has not been resolved if you could please include instructions on how to reproduce the issue to help us in our investigation. Additionally if you have any questions please let us know.

Thanks!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

I am happy to see the issue is now resolved. Thank you for updating us with the outcome.