httpd

Apache HTTP Server daemon

TLDR

Start the Apache HTTP server
$ sudo httpd
Test the configuration file syntax
$ httpd -t
Start in single-process debug mode (foreground)
$ httpd -X
List all loaded modules (static and shared)
$ httpd -M
Show version and build parameters
$ httpd -V
Use a specific configuration file
$ httpd -f [/path/to/httpd.conf]
Send a signal to a running instance (start, stop, restart, graceful)
$ httpd -k [graceful]
Stop Apache gracefully
$ httpd -k graceful-stop

SYNOPSIS

httpd [options]

DESCRIPTION

httpd is the Apache HTTP Server daemon. It serves web content using HTTP/HTTPS protocols, handling static files, CGI scripts, and reverse proxying.Apache is highly configurable through modules and configuration directives, supporting virtual hosts, access control, and numerous authentication methods.

PARAMETERS

-t

Test configuration syntax.
-T
Start without document check.
-X
Run in single-process debug mode.
-f file
Specify configuration file.
-M
List loaded modules.
-V
Show version and build info.
-k signal
Send signal to running instance: start, stop, restart, graceful, graceful-stop.
-D param
Define a runtime configuration parameter.
-d dir
Set the ServerRoot directory.
-e level
Set startup log level (debug, info, notice, warn, error, crit, alert, emerg).
-n name
Set the service name (Windows only).
-l
List compiled-in modules (static modules only).

INSTALL

sudo apt install merecat
sudo dnf install httpd
sudo apk add apache2
sudo zypper install apache2
brew install apache2
nix profile install nixpkgs#merecat

CAVEATS

Configuration can be complex for beginners due to the large number of directives and modules. Module compatibility varies between major versions. Performance tuning (MPM selection, worker/thread limits) is needed for high-traffic sites. On many Linux distributions, apachectl or systemctl is the preferred way to manage the service rather than invoking httpd directly. On Debian/Ubuntu, the binary is named apache2 instead of httpd.

HISTORY

Apache HTTP Server was started in 1995 based on NCSA HTTPd, becoming the most popular web server for decades. The Apache Software Foundation grew around it. The name comes from "a patchy server" due to its patch-based origins.

SEE ALSO

nginx(1), apache2(1), apachectl(1), a2enmod(1), htpasswd(1), caddy(1)