Why put some config info in conf/httpd.conf and some in files in the conf.d folder?

Separating configuration files is a way to manage them. By putting configuration lines specific to a module into their own files it become much easier to enable and disable modules. It also helps managing them, because now you only have a small configuration file to edit. (Imagine opening up a 500 line httpd.conf and looking for an incorrect option.)

Different systems seem to have different ways to separate apache configuration files. For example on my Gentoo there are modules.d/ and vhosts.d/, while on my Ubuntu there are conf.d/, mods-available/, mods-enabled/, sites-available/ and sites-enabled/. You can guess what they do by the name, or look inside httpd.conf for Include lines.


Since there are several packages that can provide functionality to Apache's HTTPd, the base package installs an httpd.conf that provides most of the basic settings, and other packages, such as mod_ssl, nagios and php have configuration files that need to be included per-package. The Red Hat packagers use the conf.d directory to drop the configuration in for those packages, otherwise they'd need to modify the httpd.conf for each package, which is something difficult to automate during package installation.