5

I installed the httpd package on my Amazon Linux instance and the /etc/httpd/ directory contains the subdirectories:

conf/

conf.d/

conf.modules.d/

I noticed that these are directories for configurations.

What is the difference between them?

1 Answers1

5

This is for RHEL-based Apache HTTPd configuration, Debian-based config differ significantly.

/etc/httpd/conf/ - where the main httpd configuration lives, httpd.conf, as well as some other base config files. The httpd.conf will have a directive to include the other directories. This is done so the package owns the main config file and the directories.

/etc/httpd/conf.d/ - a directory of files ending in .conf, included by the main config. The files contain snippets of httpd.conf syntax, which can override and supplement the base config. Some packages, such as mod_ssl, will include files that are placed here. It is also where the admin can set up their individual site configs.

/etc/httpd/conf.modules.d/ - a directory similar to conf.d, it is just for loading httpd modules. Packages that include a module will have a file in here to enable it so it is loaded on service start.

The main philosophy behind this structure is to make it easier for packages to drop in base configurations without needing to edit the main httpd.conf file. Since RHEL-based distros don’t start services post install, it is up to the admin of the system to modify the files appropriately before starting the httpd process. This differs from the base debian config structure, which uses directories with '-available' in their name, and the admin has to enable them with the a2enconf/a2enmod/a2ensite commands (or manually link them).

jsbillings
  • 24,006
  • 6
  • 56
  • 58