Use .conf when creating a host file for a subdomain?

So I'm in the process of setting up piwik on my linode and I've been following this guide https://www.linode.com/docs/uptime/anal … e-pangolin">https://www.linode.com/docs/uptime/analytics/piwik-on-ubuntu-12-04-precise-pangolin href="https://www.linode.com/docs/uptime/analytics/piwik-on-ubuntu-12-04-precise-pangolinhttps://www.linode.com/docs/uptime/analytics/piwik-on-ubuntu-12-04-precise-pangolin

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

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.

@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"

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct