11

What is the difference between conf-enabled and sites-enabled (or conf-available and sites-available if you want to think of it that way)?

When should a file go in one but not the other?

Are they read into apache2 differently or at different times?

BenMorel
  • 4,215
  • 10
  • 53
  • 81
stone.212
  • 247
  • 2
  • 11

2 Answers2

11

conf-enabled is for global configuration excerpts that affect all vhosts. sites-enabled should only contain complete vhost definitions.

Of course, you can also include conf-enabled/* in your vhost definition if that makes sense in your setup.

Sven
  • 97,248
  • 13
  • 177
  • 225
  • That's what I thought. But I got confused because a binary installer added its own vhosts definitions to conf-enabled/productname.conf. Thank you. – stone.212 Oct 10 '18 at 11:55
10

This entire concept does not exist if you install Apache from sources. It has been introduced by Debian/Ubuntu/... as a more structured way of organizing your files. The idea is that each virtual host stanza is put in a separate file and save in the folder sites_available. Next for the sites you actually want to enable a symbolic is created in the sites_enabled folder.

The same structure exists with conf_* directories in which you can put other configurations that you may want to enabled or disable, e.g. modules. I've never really used that part.

In the end you can do it however you want as long as you know what, where, and why. All files in the *_enabled directories are included in the apache configuration.

Edit: It's also explained in the documentation (though briefly): https://ubuntu.com/server/docs/web-servers-apache

Tommiie
  • 5,547
  • 2
  • 11
  • 45
  • You very completely missed my question. I am not asking how sites-available is different from sites-enabled. Or how conf-enabled is different from cont-available. I am asking how conf-available is different from sites-available or how conf-enabled is different from sites-enabled. Exactly like I wrote in my question. – stone.212 Oct 10 '18 at 11:54
  • 1
    Did I not state that one generally puts his virtual host configurations in site-available and other configs, e.g. modules, in conf-available? Did I not state that you can do whatever you want as they are both loaded and the concept of these directories does not exist in the default installation from sources? I believe that should answer your question. – Tommiie Oct 10 '18 at 11:58
  • Replying in order: No and yes and yes-but-that-had-nothing-to-do-with-the-question. And who cares. – stone.212 Oct 10 '18 at 12:22
  • 4
    Perhaps you should read my answer again. And with that attitude you're going to get very far in life. – Tommiie Oct 10 '18 at 12:23