Question

How to Host multiple websites using apache on ubuntu 18.04?

How to Host multiple websites using apache on ubuntu 18.04? I followed all the steps given on website but still didn’t got results. I gave paths perfectly:

<VirtualHost *:80>
    ServerAdmin admin@test.com
    ServerName test.com
    ServerAlias www.test.com
    DocumentRoot /var/www/example.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

But still it is not showing website if I am searching it. Please let me know what to do about it?


Submit an answer
Answer a question...

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.

alexdo
Site Moderator
Site Moderator badge
January 4, 2023

Hello @shaliniv37

The DNS will take a few good hours in order to update due to the DNS cache and general DNS propagation time.

You can test loading the site using another device preferably from a different network in order to conduct a more valid test.

In order to verify that the DNS is configured properly you can use our DNS lookup tool

https://www.digitalocean.com/community/tools/dns

Regards

Bobby Iliev
Site Moderator
Site Moderator badge
January 3, 2023

Hi there,

What is the exact error that you get when you try to visit your website?

Note that, after adding the Apache Virtual Host, you also need to add an A record for your domain name to point to the Droplet’s IP address:

https://docs.digitalocean.com/products/networking/dns/how-to/manage-records/

If you’ve added the DNS records already, keep in mind that it can take up to 24 hours or so for the DNS cache to clear over the Globe before you could see the new records.

Also if this is a WordPress website, I would recommend following the steps from this video here:

Let me know how it goes!

Best,

Bobby