0

I'm trying to prefix an existing Rails application with a sub-domain, essentially I want the sub-domain to serve the same application.

Right now apache2 serves my application with "www.example.com" or "example.com".

I adjusted my sites-available virtualhost in hopes of allowing for "foo.example.com" or "www.foo.example.com" however both instances are met with a domain not found error. Here is my current VirtualHost in /etc/apache2/sites-available/example.com:

<VirtualHost *:80>
  ServerName example.com
  ServerAlias foo.example.com *.example.com www.foo.example.com www.example.com
  DocumentRoot /home/user/my_app/public
  <Directory /home/user/my_app/public>
    AllowOverride all
    Options -MultiViews
  </Directory>
</VirtualHost>

Any ideas? Note, I realized I probably don't need a wild card sub-domain for what I'm trying to do, I simply added that in as a last-ditch effort.

Edit: The actual domain is virtualrobotgames.com with the desired subdomain being roboteer.virtualrobotgames.com

10
  • If you are facing "domain not found error" - most likely DNS does not resolve them. Are you sure you can resolve you Doman and subdomain names let say by using ping or dig?
    – Serhiy
    Nov 1, 2012 at 20:41
  • I have no problem pininging the website without the subdomain. I was under the impression if I just added a sub-domain prefix to my original domain as an alias in my virtualhost apache2 would automatically take it from there. Are there other steps involved?
    – Cyle
    Nov 1, 2012 at 20:48
  • 2
    You should add your subdomain on your DNS server. If your DNS is hosted by register (like godaddy) - do it from your register interface.
    – Serhiy
    Nov 1, 2012 at 21:01
  • 1
    I'm with @Serhiy here. Probably some DNS that are not properly setup. If you cannot solve yourself, you could put the actual domain name here, and let us take a look.
    – Frederik
    Nov 1, 2012 at 21:04
  • 1
    @CyleHunter You need to add A record or CNAME for roboteer.
    – Serhiy
    Nov 1, 2012 at 21:53

1 Answer 1

1
Host roboteer.virtualrobotgames.com not found: 3(NXDOMAIN)

You haven't set up DNS for your hostname. It's therefore impossible for anyone on the Internet to know how to reach the host, since its IP address can't be looked up in the DNS.

You need to set up the hostname in your DNS control panel, which seems to be hosted with GoDaddy.

1
  • Thanks, I did a little detective work and found out my website was being hosted by godaddy. I'll give them a call so they can setup a subdomain for me.
    – Cyle
    Nov 1, 2012 at 22:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .