我一直在查找有关如何启动/停止 Apache 以及从哪个目录启动/停止 Apache 的不同文档,但没有找到正确的答案。
我正在使用 Ubuntu。
在典型操作中(作为服务运行,而不是故障排除或调试等),“正确”的方法是使用以下service
命令:
service apache2 start
service apache2 stop
service apache2 restart
service apache2 reload (when you want to reload the config)
Run Code Online (Sandbox Code Playgroud)
运行它的目录无关紧要。供您参考,服务命令使用的脚本位于/etc/init.d
; Apache 位于/etc/init.d/apache2
. 所以/etc/init.d/apache2 start
等等也会得到你想要的;但是 Ubuntu 10.10 和更新版本会要求您改用该service
命令。
归档时间: |
|
查看次数: |
1266 次 |
最近记录: |