Ok, so I have got the free service of DynDNS from DynDNS.com. Now at I have a website working just fine. Now how do I, in the "sites-enabled" area, that is include in the apache config, set up more subdomains? Right now in the sites-enabled file I have

NameVirtualHost

<VirtualHost 127.0.0.1>
DocumentRoot "/var/www/"
ServerName localhost
</VirtualHost>
<VirtualHost 127.0.0.1>
DocumentRoot "/var/www/music/"
ServerName
</VirtualHost>
<VirtualHost 127.0.0.1>
DocumentRoot "/var/www/"
ServerName
</VirtualHost>
<VirtualHost 127.0.0.1>
DocumentRoot "/var/www/music"
ServerName
</VirtualHost>

What needs to change? And do I need to set anything up in the DynDNS website besides enabling wildcards?

Dani AI

Generated

A concise, practical summary of the usual solution and common pitfalls (so ’s fix is usable by others like ):

Make sure DNS and Apache are both set up for name-based hosting. DNS must resolve the subdomains you want (either create each host or enable a wildcard like *.example.sample.com so all subnames point to your public IP), and Apache must have name-based VirtualHosts that match those hostnames — binding vhosts to the loopback (127.0.0.1) will only serve local requests. Apache name-based vhostsDyn wildcard/hostname docs. (httpd.apache.org)

If you want one vhost to catch any subdomain, create a DNS wildcard (or explicit DNS records) and use ServerAlias in Apache. Many DNS panels accept * as the hostname to create a wildcard A/CNAME. Check your Dyn/zone UI for that option and remember the dynamic updater (router or ddclient) must keep the A record current. Dyn Standard DNS: wildcard hostnames. (help.dyn.com)

Minimal Apache pattern (keep this out of sites-enabled as an example — adjust paths and ownership for your distro):

# (Apache 2.2 only) NameVirtualHost *:80

<VirtualHost *:80>
  ServerName example.sample.com
  ServerAlias *.example.sample.com
  DocumentRoot /var/www/example
</VirtualHost>

Note: older Apache (2.2) used NameVirtualHost *:80; Apache 2.4 no longer requires that directive. See Apache docs for the version on your server. (httpd.apache.org)

Troubleshooting checklist: verify DNS with dig/host, test vhost mapping with apache2ctl -S (shows which names map to which config file), confirm port 80 is forwarded from your router and not blocked by a firewall, and test by curling the server IP with a Host header if DNS isn’t set up yet. If posts the exact steps that worked for them, it will save others the guesswork. (serverfault.com)

While playing around waiting for a reply found the solution. So.. I guess this topic can be closed.

Hello jtmcgee:

Is it possible for you to post the solution to your problem?

Thanks.
--Willie

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.