Make Apache listen on Floating IP only

Our Digital Ocean Droplet has a regular IP address, and we also have a Floating IP address assigned.

I’d like Apache to only listen on the Floating IP address. So any requests that come to Apache via the Droplet’s regular IP address would go unanswered.

I have tried changing

Listen 80
Listen 443


Listen FLOATING_IP:443

However, Apache fails to start and the following error is in the log:

(99)Cannot assign requested address: make_sock: could not bind to address FLOATING_IP

I’m wondering if Floating IP addresses are re-written to the main Droplet IP address prior to the traffic reaching the Droplet?

Is it possible to achieve what I would like?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there @DigitalCarrot,

In order to achieve this, what you could do is use the Anchor IP address instead.

You can find the Anchor IP by running this curl command from the server itself:

curl -s

For more information on Anchor IPs, you could take a look at the documentation here:

Hope that this helps! Regards, Bobby