I bought a cheap domain on Namecheap. It is hosted on an AWS EC2 Linux Ubuntu instance. I set it up through Route 53. The root domain works correctly.
What I'm trying to do is get a subdomain working, such as apex.rootdomain.com, and I am having much more trouble than I thought. I figured it would be much easier than setting up the root domain (which was actually pretty simple due to a great article I found).
Here is my apache2.conf:
<Directory /html/root>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /html/apex>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Here is my config file in etc/apache2/sites-available/MyConfig.conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /html/root
ServerName www.root.com
ServerAlias root.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName apex.root.com
DocumentRoot "/html/apex"
</VirtualHost>
I believe that My apache2.conf and MyConfig.conf are both correct , because they work for my main domain.
Here is how I set up the subdomain on Route 53:
Just to add, I waited about 2 or 3 days just to see if the issue would resolve itself, but it has not. Namecheap said that it takes less than 48 hour for changes to take effect.
EDIT: ZONE FILE
Hosted zone for root.com
NAME TYPE VALUE
root.com. A Elastic-IP
root.com. NS Domain-Name-A.
Domain-Name-B.
Domain-Name-C.
Domain-Name-D.
root.com. SOA some values that I don't think matter
www.root.com. A Elastic-IP
apex.root.com A Elastic-IP
Name Servers: Domain-Name-A, Domain-Name-B, Domain-Name-C, Domain-Name-D, Domain-Name-E, Domain-Name-F, Domain-Name-G, Domain-Name-H are listed as 'Name Servers' on Namecheap.
Here is what my Namecheap setup looks like:
NameServers
Customs DNS
- Domain-Name-A
- Domain-Name-B
- Domain-Name-C
- Domain-Name-D
Assuming root.com and www.root.com work in your current config, it would be as follows:
root.com. A Elastic-IP
www.root.com. A Elastic-IP
apex.root.com. A Elastic-IP
keeping in mind that on GoDaddy for your DNS it would be as follows:
@ A Elastic-IP
www A Elastic-IP
apex A Elastic-IP