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
3
  • 5
    Is there a reason you can't just bind to all interfaces? Jul 19, 2013 at 21:31
  • @MichaelHampton yes, because I don't want apache listening on external IP addresses. I want all HTTP requests going through the load balancer.
    – kojiro
    Jul 20, 2013 at 16:21
  • For example: On my router I have two sites: one is a public and one with a dashboard Aug 24, 2021 at 11:02

1 Answer 1

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.

2
  • What information exactly makes you think DSR load balancing is being used?
    – kasperd
    May 23, 2017 at 3:05
  • What do you mean? I just said that you could use a DNS instead of an IP in ports.conf May 23, 2017 at 3:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .