I'm new to Apache and Linux, and I'm reading through httpd.conf. I've come to a line in default-server.conf where it says:

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
# To disable it, simply remove userdir from the list of modules in APACHE_MODULES
# in /etc/sysconfig/apache2.

What's the relation between that file and the httpd.conf file (and the others possibly included by that) inside /etc/apache2/? I'm more concerned about modules, but a general explanation would help.



Apache HTTP Server is configured by placing directives in plain text configuration files. The main configuration file is usually called httpd.conf. The location of this file is set at compile-time and some distributions may elect to use a different name. Also the configuration file name may be overridden at start up with the -f command line flag.

The configuration file is parsed from top to bottom in sequence, and usually the order of directives matters.

In addition, other configuration files may be added using the Include and IncludeOptional directives in the http.conf, and wildcards * can be used to include many configuration files. Include files themselves may also contain the Include directive.

Included files will be merged with the main httpd.conf at the locations of the Include directives.

Any directive may be placed in any of these configuration files. Changes to the main configuration files are only recognized by httpd when it is started or restarted.

A fairly typical httpd.conf looks something akin to this:

# httpd.conf

IncludeOptional early-includes/*.conf

More Directives

IncludeOptional late-includes/*.conf

Even More Directives

IncludeOptional active-virtualhosts/*.conf

where any/all *.conf files are included in lexicological order.

I think your /etc/sysconfig/apache2 is not a httpd.conf file nor an Include , usually such /etc/sysconfig/ files are sourced by a start-up script and used set commandline parameters and options.

  • Very clear and, yep, your last supposition is right: that /etc/sysconfig/apache2 looks like an options file. But where are APACHE_MODULES and other options documented? It seems I can't find them even with a search engine. – watery Jun 11 '18 at 8:52
  • My RHEL/CentOS httpd.conf configures modules by loading them from an early include such as /etc/httpd/conf.modules.d/00-base.conf: LoadModule userdir_module modules/mod_userdir.so and configures the loaded module from a late include such as /etc/httpd/conf.d/userdir.conf – HBruijn Jun 11 '18 at 9:17
  • @HBruijin , I have used make to build httpd and placed it in /etc/httpd on RHEL 7.6. I am trying to resolve an issue with siteminder agent and the resolution community.broadcom.com/communities/community-home/digestviewer/… asks me to update /etc/sysconfig/httpd file. Where do I find this config file. It seems like the file gets created. when I do yum install for httpd – Nate Mar 19 '20 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.