LinuxCommandLibrary

apache2ctl

Manage the Apache HTTP Server on Debian

TLDR

Start the Apache daemon

$ sudo apache2ctl start
copy
Stop the Apache daemon
$ sudo apache2ctl stop
copy
Restart the Apache daemon
$ sudo apache2ctl restart
copy
Test syntax of the configuration file
$ sudo apache2ctl -t
copy
List loaded modules
$ sudo apache2ctl -M
copy
Restart gracefully without dropping connections
$ sudo apache2ctl graceful
copy

SYNOPSIS

apache2ctl command
apache2ctl [httpd-argument]

DESCRIPTION

apache2ctl is a front end to the Apache HyperText Transfer Protocol (HTTP) server designed to help administrators manage the Apache daemon. This command comes with Debian-based operating systems; for RHEL-based ones see httpd.

PARAMETERS

start

Start the Apache daemon; errors if already running
stop
Stop the Apache daemon
restart
Restart Apache via SIGHUP; includes config validation
graceful
Restart without terminating active connections
graceful-stop
Stop Apache without aborting current connections
status
Show brief operational status report
fullstatus
Display comprehensive status via mod_status (requires lynx)
configtest
Validate syntax in configuration files
-t
Test configuration file syntax
-M
List loaded modules
-S
Print full Apache configuration

CONFIGURATION

/etc/apache2/apache2.conf

Main configuration file on Debian/Ubuntu systems.
/etc/apache2/sites-available/
Virtual host configuration files, enabled via a2ensite.
/etc/apache2/mods-available/
Module configuration files, enabled via a2enmod.
/etc/apache2/envvars
Environment variables for the Apache process (user, group, pid file).
/etc/apache2/ports.conf
Listen directives specifying which ports Apache binds to.

CAVEATS

Debian requires environment variables APACHE_RUN_USER, APACHE_RUN_GROUP, and APACHE_PID_FILE set in /etc/apache2/envvars.

HISTORY

Part of the Apache HTTP Server project, one of the oldest and most widely used web servers, developed by the Apache Software Foundation.

SEE ALSO

apachectl(8), a2enmod(8), a2dismod(8), a2ensite(8), httpd(8)

> TERMINAL_GEAR

Curated for the Linux community

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
Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

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

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

$54.00
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
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