How can I add a subdomain to my website?

February 17, 2016 904 views

I want to have instead of
How can I make it happen?

I own a Ubuntu 14.04 x64 droplet.

My droplet has everything from the "Initial Server Setup with Ubuntu 14.04" tutorial.

2 Answers

Hey there,

You would create a virtual host for the domain pointing to a different folder than your's document root. This tutorial reviews setting up virtual hosts (multiple websites) for Apache running on Ubuntu.

You would also need to create an A record in your DNS zone pointing artwork to your IP address.

Happy coding,

Jon Schwenn
Platform Support Specialist

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.
  • Now am in the stage where I have up and running and I can access it in a web browser with no problem. However, I did not do any A record thingy. Do I need to do it, if so how?

    • There are a few reasons why it may work without creating an A record:

      1. You hardcoded in your hosts file
      2. You have a wildcard CNAME or A record

      As long as it's working regardless of the computer/internet connection, I would leave it be :)

  • Hi, there!

    Do you mean that for every subdomain like or, I need to create a new virtual host every time? Thanks in advance!

Have another answer? Share your knowledge.