Report this

What is the reason for this report?

How to Configure Apache Virtualhost so Floating IP will work with multiple domains on one droplet?

Posted on April 20, 2019

I set up a floating IP on my droplet. My droplet uses Apache Virtual Hosts to host multiple domains. One of my domains works fine, as it should after I change the A Record to point to the Floating IP (the same domain that is shown when I type with my default ipv4 IP number into a browser).

However, when I change the A record for each of the other domains in my droplet and point them to the Floating IP, the sites stop working. Is there a .config file that I need to modify for each of my domains virtual host?

My reason for wanting to use the Floating IP instead of the ipv4 IP is so I could easily switch traffic to another droplet without having to wait for DNS records to propogate. This works beautifully on the main site but not on the other sites created via Apache Virtual Hosts.

By the way, I am using Ubuntu 14.04 and want to have this working fine before I switch the Floating IP number to point to a new Ubuntu 18.04 droplet with a similar configuration.



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!

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.

Hello,

I had a similar setup in the past. What I did was to specify * in each virtual host on port 80 and 443 rather than specifying an IP address.

Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.