Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.


I'm trying to setup a webserver at home using the free DynDNS service and subdomains. I've been successful hosting a single site with DynDNS, but now I want to setup subdomains so that I can host multiple sites on my personal webserver using the DynDNS domain.

For example, let's say I've registered with DynDNS myname.homelinux.net. I would be able to host sites on the following domains:
myname.homelinux.net
test.myname.homelinux.net
test2.myname.homelinux.net
...


When I register a DynDNS domain name such as myname.homelinux.net, do I need to do anything on the DynDNS web portal to route any subdomains to my site, or is that something I have full control of in my webserver's Apache configurations? Is there something about my configurations (below) that would cause this not to work?

My configurations:

In file /etc/apache2/sites-available/test.conf

<VirtualHost *:80>
  DocumentRoot /var/www/sub/test
  ServerName test.myname.homelinux.net
  #ServerPath /test/
  #RewriteEngine On
  #RewriteRule ^(/test/.*) /www/test$1
    ErrorLog /var/log/apache2/error.test.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.test.log combined
</VirtualHost>

I use the default configuration for Apache to host the main mysite.homelinux.net site.
/etc/apache2/sites-available/default (this works fine)

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

Currently, when I browse to http://test.mysite.homelinux.net/, I get a "Server Not Found" error.

You can assume that I have run the 'a2ensite test.conf' command and reloaded Apache parse the configs each time I make changes to them.

Any help is much appreciated. Thanks, Joe

share|improve this question

1 Answer 1

up vote 1 down vote accepted

When I register a DynDNS domain name such as myname.homelinux.net, do I need to do anything on the DynDNS web portal to route any subdomains to my site, or is that something I have full control of in my webserver's Apache configurations?

To the best of my understanding, your Apache configurations look sane. I expect your problem is that DNS can't resolve test.mysite.homelinux.net.

You could test by setting the right IP address for that hostname in your computer's HOSTS file. In Windows it's C:\WINDOWS\system32\drivers\etc\HOSTS; in Linux or other Unixen it's /etc/hosts. That way your test computer will know what address to use for that hostname, and allow you to test your Apache configuration.

To the best of my knowledge, DynDNS doesn't do subdomains as part of their free Dynamic DNS service. They do support subdomains as part of their Custom DNS service. Also, according to this question, the Dynamic DNS Pro service also provides wildcards and subdomains. Please direct further questions about DynDNS configuration to the DynDNSCommunity Stack Exchange site.

share|improve this answer
    
see also superuser.com/questions/127807/custom-personal-dyndns-solution for a method of setting subdomains on a domain you own to resolve to a single DynDNS site via CNAMEs. so if you owned mydomain.com you could use one DynDNS name, mysite.homelinux.net, and set CNAMEs for test.mydomain.com and foo.mydomain.com and bar.mydomain.com to all resolve back to mysite.homelinux.net. your apache configuration should handle the rest. –  quack quixote Jun 20 '10 at 22:44
    
Thank you quack quixote for this info. I was afraid that it was a limitation of that free service of some sort. I like the idea of testing the configuration using the hosts file. Thanks for the link to the DynDNS Community Stack Exchange. That seems like a good resource to know about. –  Joe J Jun 22 '10 at 13:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.