Stop Apache from using port 80

Maybe a trivial solution available, but I did not find one so far.

I’m trying to use HAProxy and bind it to the red interface, port 80.
When starting HAProxy, it tells me that it cannot bind to port 80.

After searching around and doing some tests, I’ve found that the local Apache webserver is claiming port 80 for itself. Of course Apache uses port 81 and 444 by default for the IPFire WebIF, but it binds to port 80, and maybe to port 443!

How to find this out? Stop Apache and start HAProxy first to bind to the red interface, port 80. HAProxy starts w/o any issues now.
As a second step, start Apache and you will see those errors:

Starting Apache daemon…
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address
no listening sockets available, shutting down
AH00015: Unable to open logs [ FAIL ]
As you can see, Apache itself is binding to port 80 using all available IP-addresses, which obviously means, the red interface, too. So no chance for HAproxy when starting after Apache!

I’ve tried to get around this problem, as some sites suggested, and edited /etc/httpd/conf/listen.conf by adding a to each line


to no avail so far.

Using command lsof | grep :http wil lgive you this result when Apache runs:

So how to stop Apache from using port 80 and 443?

Solved this issue by further debugging. A virtual host running on Apache that was bound to port 80, stopped HAProxy from starting up.

This virtual host was used so far for configuring an automatic distribution of the wpad file - a proxy configuration file. After removing this one and restarting Apache, all runs well now.

Let’s see if I still need this virt. host or if HAProxy itself can take the role for the file’s distribution to the clients…