Report this

What is the reason for this report?

Setup sub-domain from a different host pointed to droplet running Apache

Posted on May 15, 2019

Given I have an example.com domain hosted on a different name-server different from Digital Ocean’s. Tutorials and links say to add an A record for the sub-domain using the DNS manager of the current host. I did that and added an app.example.com sub-domain and pointed it to the IP address of the droplet running the application to be hosted on the sub-domain.

Now, the A records look like so

Zone id. 	************

Record Id 	***********

Name 	app.example.com

Class 	IN

Type 	A

Status 	Active

Value 	dropletIPAddressHere

TTL 	7200

Creation Date 	2019-05-15 03:54:22.909377 

Now, in my droplet, I have Apache configured like so

        ServerName app.example.com
        ServerAlias www.app.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/public

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>

        <Directory /var/www/html>
                AllowOverride All
        </Directory>

However, I still can’t reach the application through the sub-domain URL but using it’s IP address things work just fine. Is there anything I still need to do on my end? Please help!!!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.