Apache2 Upgrade Broke with Bind Error

A brief outage happened on my website this afternoon. While applying some package updates that didn’t happen automatically on the Linux server hosting the WordPress blog, the upgrade broke, and then Apache httpd server subsequently refused to start. Not too much to worry, actually, I am a seasoned Linux user who should be able to fix this quickly.

Except that there were no output in the Apache logs. Ok, still, no need to worry. I’ll check systemd status for the apache2 service.

Jul 01 12:28:08 xxx systemd[1]: Starting The Apache HTTP Server...
Jul 01 12:28:08 xxx apachectl[1146]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:443
Jul 01 12:28:09 xxx systemd[1]: Started The Apache HTTP Server.
Jul 01 12:28:09 xxx systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
Jul 01 12:28:09 xxx apachectl[1457]: httpd (no pid file) not running
Jul 01 12:28:09 xxx systemd[1]: apache2.service: Unit entered failed state.
Jul 01 12:28:09 xxx systemd[1]: apache2.service: Failed with result 'exit-code'.

Ok, that sounds simple. There was a bind failure on port 443, so something was already listening there. Perhaps Apache was started after all, or there was some old process left hanging around.

But no, there were no other Apache processes. Running netstat -an¬†also revealed that there was nothing listening on port 443. Fine, let’s start Apache again. Same error.

How strange right? It’s complaining that something’s already on port 443, but there’s nothing I can see from the OS.

Well, a quick Google search revealed usual helpful answers from the likes of StackOverflow. Interestingly, this question was from 5 years ago, but it’s only just something that surfaced for me.

For some strange reason, a new ssl.conf was installed with the Listen 443 directive, which was already present in another local configuration file. The double Listen 443 directives was causing this bind error.

It would have been nice for Apache to simply ignore the second, redundant, directive, of if otherwise at least emit a helpful warning about it. Not just give up with an unhelpful bind error.

Problem fixed. A little annoyed that my coffee break was interrupted.

One Response to Apache2 Upgrade Broke with Bind Error

  1. I’d buy you a coffee if I could…
    gentoo-based system was recently updated. Seems there was a residual configuration file left behind that read exactly the same as newly install config file. Remove the older one…and we’re back.

Leave a Reply

Your email address will not be published. Required fields are marked *