16

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?

2 Answers 2

14

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.

1
  • 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, 2018 at 11:55
14

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

4
  • 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, 2018 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, 2018 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, 2018 at 12:22
  • 5
    Perhaps you should read my answer again. And with that attitude you're going to get very far in life.
    – Tommiie
    Oct 10, 2018 at 12:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .