Question

Apache virtual host with multiple domain name (cloudflare)

Hello everyone,

I have 2 domain name and have followed this tutorial https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-18-04 to set up my both domain on 2 different Apache virtual host (one for each domain name)

The first domain works well and point on the good virtual host.

But the second domain keeps pointing on the first domain/virtual host (even after defining the two domain name in the host file as mentioned in the tutorial above)

The difference here is the cloudflare ; the 2 domains point on the same IP (for my droplet)

If anyone has an idea about this weird behaviour and would want to help…

Thank you in advance for reading and help

Regards


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.

Accepted Answer

Found the problem =)

I have had to purge the cloudflare cache!

KFSys
Site Moderator
Site Moderator badge
April 17, 2021

Hi @micheltruong,

I’m glad you were able to find out the answer to your issue!

I’ll post my message here just in case some other people find it in the future and wonder why.

Basically, CloudFlare is a content delivery network (CDN). A CDN is a distributed network of servers that provides several advantages for a website:

  1. Cached content
  2. High availability
  3. Increased security

While this is very good for your websites/apps sometimes you can experience issues like the above. Basically, your content Caches and your changes are not seen right away on your website.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

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.