Use .conf when creating a host file for a subdomain?
I'm at the point where I am configuring a dedicated Virtual Host for Piwik. I already added a new A record for the subdomain through my linode DNS tools. My next step is to create the subdomain host file in apache. In the linode guide it says to create a file like this:
/etc/apache2/sites-available/stats.example.org
But when I created virtual host files before for the main domain I added .conf at the end like this:
/etc/apache2/sites-available/example.org.conf
Is this an error in the linode guide? Should my subdomain host file end in .conf? Or is it different when creating subdomains?
Also
Do I need to add any other DNS records besides an A record when creating a subdomain? Like a cname record etc?
2 Replies
The .conf extension is option. Many people use it because it clearly identifies what type of file it is (a configuration file).
You could use a CName record that points to your primary A record. I usually add an A record for a subdomain so I can point the subdomain to a different server if I ever want/need to.
@Main Street James:
saladdays,
The .conf extension is option. Many people use it because it clearly identifies what type of file it is (a configuration file).
You could use a CName record that points to your primary A record. I usually add an A record for a subdomain so I can point the subdomain to a different server if I ever want/need to.
It's a really good idea to use .conf because (for example) during the upgrade from Apache 2.2 to 2.4, if you weren't using .conf on your virtual hosts then they stopped working.
From Linode's own documentation:
"Ubuntu and Debian: Virtual host configuration files in the sites-available directory must now use the .conf extension"