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

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community