LinuxCommandLibrary

apachectl

Control the Apache HTTP Server

TLDR

Start the server

$ sudo apachectl start
copy
Restart the server
$ sudo apachectl restart
copy
Stop the server
$ sudo apachectl stop
copy
Test configuration file validity
$ apachectl configtest
copy
Check server status (requires lynx browser)
$ apachectl status
copy
Reload configuration without dropping connections
$ sudo apachectl graceful
copy
Print full Apache configuration
$ apachectl -S
copy

SYNOPSIS

apachectl command
apachectl [httpd-argument]

DESCRIPTION

apachectl is a front end to the Apache HyperText Transfer Protocol (HTTP) server designed to help administrators manage the Apache daemon. It can operate in SysV init mode with simple commands or pass arguments directly to httpd.

PARAMETERS

start

Start the Apache daemon
stop
Stop the Apache daemon
restart
Restart Apache; starts if not running
graceful
Graceful restart without terminating active connections
graceful-stop
Graceful stop without aborting current connections
configtest
Validate syntax in configuration files
status
Display brief operational status (requires lynx and mod_status)
fullstatus
Display comprehensive status report
-S
Print full Apache configuration (parsed vhosts)
-t
Test configuration syntax
-M
List loaded modules
-h
Display help

CONFIGURATION

/etc/httpd/conf/httpd.conf

Main configuration file on RHEL/CentOS/Fedora systems.
/etc/apache2/apache2.conf
Main configuration file on Debian/Ubuntu systems.
/etc/httpd/conf.d/
Directory for additional configuration files on RHEL-based systems.
/etc/apache2/sites-available/
Virtual host configuration files on Debian-based systems.

CAVEATS

The status and fullstatus commands require the lynx text browser and mod_status to be enabled.

HISTORY

Part of the Apache HTTP Server project, developed by the Apache Software Foundation since 1995.

SEE ALSO

apache2ctl(8), httpd(8)

> TERMINAL_GEAR

Curated for the Linux community

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00