我知道三种重启 Apache 的方法:
sudo /usr/sbin/apachectl restart
sudo /etc/init.d/apache2 restart
service apache2 restart
Run Code Online (Sandbox Code Playgroud)
每种方式在下面做什么?
我也尝试过service apache2 stop
在 Ubuntu 上使用,但由于某种原因它不会停止服务器:本地主机仍然在我的桌面上运行。
ale*_*xus 10
service
和/或init.d
脚本与它运行相同的httpd
脚本完全相同,这主要是为了stop
和(re)start
httpd
服务,而apachectl
可以做更多(见输出)。
apachectl
:
# apachectl
Usage: /usr/sbin/httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
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 settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files
#
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9262 次 |
最近记录: |