5

I bought a domain from Namecheap and I have all my files hosted on EC2. I set my A Addresses on Namecheap to my elastic IP and so far it's working.

When I try to create subdomains (using this guide) on my Apache's vhost but there is no connection. Do I need to set up anything specific in the Namecheap host records or EC2?

I'm running a standard virtual Ubuntu server with LAMP. I tried the normal things like restarting Apache and checking error logs (nothing found).

Community
  • 1
  • 1
Sosa
  • 814
  • 1
  • 9
  • 20
  • "It's not working for some reason" is not useful to help you. Did you restarted apache after adding the VirtualHost block to your apache settings? Check your apache server logs to see what is going on. – E. Celis Jul 01 '15 at 14:21
  • Yes I tried restarting apache. There is no access or error logs appearing for the subdomain I set either. The problem is when I go to the site in my browser there is no connection. I've waited a couple hours for the DNS, too. – Sosa Jul 01 '15 at 14:33
  • As @e-j-brennan said, you must have DNS records for your subdomains too. – E. Celis Jul 01 '15 at 16:13

1 Answers1

5

If you want to use a subdomain, you will also need to point that subdomain to the elastic ip as well in your namecheap DNS, and then bind the subdomain in apache to the website/location that it should serve files from.

E.J. Brennan
  • 45,870
  • 7
  • 88
  • 116
  • Thanks for your answer. Should Namecheap be set up like http://puu.sh/iJG3B/00a45908c9.png? DNS takes time to work so i'm never sure if I set it up correctly. – Sosa Jul 01 '15 at 17:53
  • that should work. You could also use a cname to send dev to the base ip, but I actually prefer the a record as you have done.. – E.J. Brennan Jul 01 '15 at 17:54