← 返回命令列表

Linux command

httpd 命令

安全

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

常用示例

Start

sudo httpd

Test

httpd -t

Start

httpd -X

List all loaded

httpd -M

Show version

httpd -V

Use a specific

httpd -f [/path/to/httpd.conf]

Send a signal

httpd -k [graceful]

Stop

httpd -k graceful-stop

说明

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.

参数

-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).

FAQ

What is the httpd command used for?

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.

How do I run a basic httpd example?

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

What does -t do in httpd?

Test configuration syntax.