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:
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?
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