Forum Moderators: phranque
I am trying to bind my Apache2 to specific IP addresses. Currently in the apache conf I have:
Listen 80
NameVirtualHost 80.xx.xx.15:80
NameVirtualHost 80.xx.xx.17:80<VirtualHost 80.xx.xx.15:80>
When I change the Listen part to :
Listen 80.xx.xx.15:80
Listen 80.xx.xx.17:80
Shutdown the server, check that nothing is running on port 80, and restart I get the error message:
(98)Address already in use: make_sock: could not bind to address 80.xx.xx.15:80 no listening sockets
and Apache exits. I have no other Listen's elsewhere in the code (I do have a ServerName outside of the Virtualhost, if that makes a difference?). I change it back to Listen 80 and it works again no problem! I'm limited to experiment too much, as it's a live server.
What could be the problem? Please help!
[httpd.apache.org...]
Error condition
Multiple Listen directives for the same ip address and port will result in an Address already in use error message.
However in the documentation there is at least one example using your syntax, and the above quote gives the impression that the error condition would be because both the IP address and port are the same.
I'm still trying to find a solution. :)
Which Apache version are you using, on which OS?
Here is my /etc/network/interfaces file:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 80.xx.xx.14
netmask 255.255.255.0
network 80.xx.xx.0
broadcast 80.xx.xx.255
gateway 80.xx.xx.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 80.xx.xx.20
dns-search xx.co.uk
iface lo:1 inet static
address 80.xx.xx.15
netmask 255.255.255.255
iface lo:2 inet static
address 80.xx.xx.16
netmask 255.255.255.255
iface lo:3 inet static
address 80.xx.xx.17
netmask 255.255.255.255