Linux command
apache2ctl 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Start
sudo apache2ctl start
Stop
sudo apache2ctl stop
Restart
sudo apache2ctl restart
Example
sudo apache2ctl -t
Example
sudo apache2ctl -M
Example
sudo apache2ctl graceful
说明
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.
参数
- 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
FAQ
What is the apache2ctl command used for?
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.
How do I run a basic apache2ctl example?
Run `sudo apache2ctl start` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does start do in apache2ctl?
Start the Apache daemon; errors if already running