How do i Host 2 Websites in One Droplets?

May 5, 2015 1.4k views
DNS PHP Ubuntu

Hi

Say i have a droplet, I need to host two websites in that, How can i point DNS ? and make it both work?

2 Answers

You can host as many sites on a single droplet as you like. To do this you would create a DNS A record pointing the new domain or subdomain to your droplet's IP address and configure a new virtualhost in your web server configuration. This tutorial will walk you through setting up a virtualhost configuration.

by Justin Ellingwood
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.

Just point both the hosts through your DNS to same IP address. When the request will be received by your server it will look out for the enabled hosts on your server.

If you are using Apache on Ubuntu 12.04 then follow this guide..

If you have trouble figuring it out, let me know. I would be happy to help you :]

by Etel Sverdlov
This tutorial shows you how to set up a new directory, how to grant the correct permissions, how to add content to a new page, how to turn on virtual hosting, and how to, if needed, set up local hosts. Virtual Hosts are used to run more than one domain off of a single IP address and allows you to run multiple sites off of a single DigitalOcean droplet. This tutorial describes how to set up virtual hosts with Apache.
Have another answer? Share your knowledge.