Apache HTTP Server separates its settings across a main configuration file and included files. Identifying them also requires checking whether the running service overrides the packaged paths.
Apache reads the main file first, then follows Include and IncludeOptional directives. A file can exist in a configuration directory without being included, and enabled directories often contain symlinks to the editable source files.
Debian and Ubuntu name the server package apache2 and its control command apache2ctl, while RHEL-style systems use httpd. Configuration dumps read files as they exist now, which can differ from the running server after an edit that has not been reloaded.
Steps to find Apache configuration files:
- Print the server root and main configuration file.
$ apache2ctl -V Server version: Apache/2.4.66 (Ubuntu) Server built: 2026-10-08T19:55:44 ##### snipped ##### -D HTTPD_ROOT="/etc/apache2" ##### snipped ##### -D SERVER_CONFIG_FILE="apache2.conf"
The two values combine to /etc/apache2/apache2.conf, the main configuration file. On RHEL-style systems, httpd -V gives /etc/httpd and conf/httpd.conf instead.
A service started with a custom -f or -d option uses those paths instead, and systemctl status apache2 shows its start command.
- List every file Apache loads.
$ sudo apache2ctl -t -D DUMP_INCLUDES Included configuration files: (*) /etc/apache2/apache2.conf (146) /etc/apache2/mods-enabled/access_compat.load (146) /etc/apache2/mods-enabled/alias.load ##### snipped ##### (150) /etc/apache2/ports.conf (222) /etc/apache2/conf-enabled/charset.conf (222) /etc/apache2/conf-enabled/localized-error-pages.conf (222) /etc/apache2/conf-enabled/other-vhosts-access-log.conf (222) /etc/apache2/conf-enabled/security.conf (222) /etc/apache2/conf-enabled/serve-cgi-bin.conf (222) /etc/apache2/conf-enabled/servername.conf (225) /etc/apache2/sites-enabled/000-default.confThe (*) entry is the main file; numbers beside included paths identify the including directive's line.
An AH00558 warning can accompany the paths without invalidating them.
- Print the server root and other run-time paths.
$ sudo apache2ctl -t -D DUMP_RUN_CFG ServerRoot: "/etc/apache2" Main DocumentRoot: "/var/www/html" Main ErrorLog: "/var/log/apache2/error.log" ##### snipped ##### PidFile: "/run/apache2/apache2.pid" Define: DUMP_RUN_CFG User: name="www-data" id=33 Group: name="www-data" id=33
This output covers the main server, not every virtual host.
- List the enabled configuration links.
$ ls -l /etc/apache2/*-enabled ##### snipped ##### /etc/apache2/sites-enabled: total 0 lrwxrwxrwx 1 root root 35 Nov 5 16:30 000-default.conf -> ../sites-available/000-default.conf
On Debian and Ubuntu, each link under /etc/apache2/*-enabled/ points to its source file under /etc/apache2/*-available/.
- Search the configuration tree for a directive.
$ sudo grep -Rn DocumentRoot /etc/apache2 /etc/apache2/sites-available/000-default.conf:12: DocumentRoot /var/www/html /etc/apache2/sites-available/default-ssl.conf:4: DocumentRoot /var/www/html /etc/apache2/sites-enabled/000-default.conf:12: DocumentRoot /var/www/html
This search also returns disabled files and comments, so check each path against the include list.
- Find the file that defines each site.
$ sudo apache2ctl -S VirtualHost configuration: *:80 apache.example.net (/etc/apache2/sites-enabled/000-default.conf:1) ServerRoot: "/etc/apache2" ##### snipped #####
The path and line number locate the VirtualHost block for that address or hostname.
Default Apache configuration location
These are the usual layouts for common installations. A custom main file can include files outside these directories.
- Debian and Ubuntu packages use /etc/apache2 as ServerRoot and /etc/apache2/apache2.conf as the main file. Common configuration locations are /etc/apache2/mods-enabled, /etc/apache2/conf-enabled, /etc/apache2/ports.conf, and /etc/apache2/sites-enabled.
- RHEL-style packages use /etc/httpd as ServerRoot and /etc/httpd/conf/httpd.conf as the main file. Common configuration locations are /etc/httpd/conf.modules.d and /etc/httpd/conf.d.
- openSUSE and SLES packages commonly use /srv/www as ServerRoot and /etc/apache2/httpd.conf as the main file. Common configuration locations include /etc/apache2/sysconfig.d, /etc/apache2/conf.d, /etc/apache2/default-server.conf, and /etc/apache2/vhosts.d.
- Homebrew httpd on Apple Silicon commonly uses /opt/homebrew/opt/httpd as ServerRoot and /opt/homebrew/etc/httpd/httpd.conf as the main file. Additional configuration templates are under /opt/homebrew/etc/httpd/extra; only files referenced by the configuration are included.
- An upstream source build defaults to /usr/local/apache2 as the installed prefix and /usr/local/apache2/conf/httpd.conf as the main file unless configured with another prefix. Extra files are loaded only when added through Include or IncludeOptional.
On Intel macOS systems, the common Homebrew prefix is /usr/local/ instead of /opt/homebrew/.
Default Apache configuration value
These common defaults show which command and service name each platform uses, and help interpret the DUMP_RUN_CFG output.
- Debian and Ubuntu packages use apache2ctl, the apache2 server binary, and the apache2.service unit. The common DocumentRoot is /var/www/html, and the worker user and group are www-data.
- RHEL-style packages use httpd for build and configuration dumps with the httpd.service unit. The common DocumentRoot is /var/www/html, and the worker user and group are apache.
- Homebrew httpd on Apple Silicon uses apachectl or httpd and is commonly managed with brew services. The common DocumentRoot is /opt/homebrew/var/www, and the worker user and group are _www.
- An upstream source build uses apachectl and httpd under the installed prefix. The default DocumentRoot is /usr/local/apache2/htdocs unless changed in httpd.conf or by local packaging.
openSUSE and SLES split several defaults across /etc/apache2/uid.conf, /etc/apache2/default-server.conf, and /etc/apache2/vhosts.d/, so a configuration dump is more reliable than assuming one file contains every default.