使用 graceful 重启 Apache 服务
graceful 单词本意是优雅的,优美的。即,优雅的重启 Apache 服务。
# 此参数可用于 apachectl 或 httpd 命令httpd -k gracefulapachectl graceful
参数graceful用于重新启动 Apache 服务器,但不会中断原有的连接。可用于修改配置文件后,使新配置文件立即生效。相比较其他参数restart或stop -> start能更加优雅的重启 Apache 服务。
关于httpd -k更多参数:
httpd [-k start|restart|graceful|graceful-stop|stop]
httpd 扩展
httpd 的使用方法:
Usage: httpd [-D name] [-d directory] [-f file][-C "directive"] [-c "directive"][-k start|restart|graceful|graceful-stop|stop][-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]Options:-D name : define a name for use in <IfDefine name> directives-d directory : specify an alternate initial ServerRoot-f file : specify an alternate ServerConfigFile-C "directive" : process directive before reading config files-c "directive" : process directive after reading config files-e level : show startup errors of level (see LogLevel)-E file : log startup errors to file-v : show version number-V : show compile settings-h : list available command line options (this page)-l : list compiled in modules-L : list available configuration directives-t -D DUMP_VHOSTS : show parsed vhost settings-t -D DUMP_RUN_CFG : show parsed run settings-S : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG-t -D DUMP_MODULES : show all loaded modules-M : a synonym for -t -D DUMP_MODULES-t -D DUMP_INCLUDES: show all included configuration files-t : run syntax check for config files-T : start without DocumentRoot(s) check-X : debug mode (only one worker, do not detach)
apachectl 扩展
apachectl 命令可用来控制 Apache HTTP 服务器的程序。
apachectl 是 slackware 内附 Apache HTTP 服务器的 script 文件,可供管理员控制服务器,但在其他 Linux 的 Apache HTTP 服务器不一定有这个文件。
语法:
apachectl [configtest][fullstatus][graceful][help][restart][start][status][stop]
参数:
| 参数 | 描述 |
|---|---|
configtest |
检查设置文件中的语法是否正确。 |
fullstatus |
显示服务器完整的状态信息。 |
graceful |
重新启动 Apache 服务器,但不会中断原有的连接。 |
help |
显示帮助信息。 |
restart |
重新启动 Apache 服务器 |
start |
启动 Apache 服务器。 |
status |
显示服务器摘要的状态信息。 |
stop |
停止 Apache 服务器。 |
(完)