← 返回命令列表

Linux command

apachectl 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Start

sudo apachectl start

Restart

sudo apachectl restart

Stop

sudo apachectl stop

Example

apachectl configtest

Example

apachectl status

Reload

sudo apachectl graceful

Example

apachectl -S

说明

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.

参数

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 (passed to httpd)
-V
Show httpd compile-time settings and version
-l
List statically compiled modules
-h
Display help

FAQ

What is the apachectl command used for?

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.

How do I run a basic apachectl example?

Run `sudo apachectl start` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does start do in apachectl?

Start the Apache daemon