2

This may be a bit of an X-Y question: I want to be able to clone and destroy cloud servers and not reconfigure the Listen directive for Apache that only the load balancer can get to. But I don't actually care what the ip address is – it's whatever IP address that interface has. But looking through the Apache documentation, it seems you can only give Listen an ip address, not an interface. Is there no way to specify that Apache should listen on a specific interface?

What I have:

NameVirtualHost *:80
Listen 10.177.19.174:80

What I want:

NameVirtualHost *:80
Listen eth1:80
kojiro
  • 559
  • 3
  • 8
  • 25

1 Answers1

2

Old thread, but still.

It seems you can't, BUT you can listen on a DNS:

Listen myhost.mydomain.tld:80

Which is still better than hardcoding IP. Please note that the IP will be resolved when apache starts, and won't change if the DNS value changes.

Robin Thoni
  • 183
  • 1
  • 6