How can I host multiple domains in one droplet???

July 2, 2015 8.2k views
DNS Apache CentOS

Hi. I would like to host multiple domains in one droplet.

Is it possible to do that without using virtual hosting in Apache???

I understand that each droplet gets one IP. Is it possible to have more IP's being served by the same droplet so as each website to have each own IP??? (sorry if that question sounds stupid).

2 Answers

You'd have to use vhosts, it's not too hard setting it up long as you correctly follow a vhost setup tutorial.

Your question isn't stupid, but I would strongly suggest re-thinking why you're trying to do this all in this particular way.

You could in theory host a bunch of different web servers on different ports, but why not just use Apache or nginx and use their respective methods for attaching multiple websites to the installation?

Apache Virtual Hosts tutorial:

The only way you can do 1 IPv4 address per website is to host them on separate droplets. You can do some DNS tomfoolery to actually run all the websites off a single droplet and these extra "IP only" droplets serve as a $5/mth extra fee and can forward traffic to your actual website.

The possibilities are endless. Your willingness to pay may not be. But one thing to consider is look for the simple, common solution before ideas and plans get complicated, bloated, or poorly designed.

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.
Have another answer? Share your knowledge.