Difficulty: Easy
Correct Answer: /etc/httpd/conf/httpd.conf
Explanation:
Introduction / Context:
Apache HTTP Server reads configuration directives from one or more files. Knowing the correct location of the main configuration file is crucial for enabling modules, defining virtual hosts, setting document roots, and tuning performance and security. File paths vary by distribution family (Red Hat vs. Debian), so exams often focus on the conventional path for a given family.
Given Data / Assumptions:
Concept / Approach:
On Red Hat–based systems, the principal configuration file is /etc/httpd/conf/httpd.conf
. This file may include additional files (for example, files in /etc/httpd/conf.d/
) through 'Include' or 'IncludeOptional' directives, but httpd.conf
is the canonical starting point. Other paths listed either belong to different families, are obsolete, or use incorrect names/extensions.
Step-by-Step Solution:
Verification / Alternative check:
Run 'httpd -V' to see 'SERVER_CONFIG_FILE' path compiled into the binary. On Debian/Ubuntu, the equivalent primary file is usually '/etc/apache2/apache2.conf', illustrating distribution differences and reinforcing why the Red Hat path is correct here.
Why Other Options Are Wrong:
Common Pitfalls:
Editing included files without understanding load order, forgetting to run a config test, or mixing Debian and Red Hat paths in documentation.
Final Answer:
/etc/httpd/conf/httpd.conf
Discussion & Comments