要在Debian上停止Apache服务,您可以使用以下命令之一:
- 使用
systemctl
命令(适用于systemd):
sudo systemctl stop apache2
- 使用
service
命令(适用于SysVinit):
sudo service apache2 stop
- 使用
/etc/init.d
脚本(适用于旧版本的Debian):
sudo /etc/init.d/apache2 stop
在执行这些命令后,Apache服务将停止运行。如果您需要重新启动Apache服务,可以使用类似的命令:
- 使用
systemctl
命令:
sudo systemctl start apache2
- 使用
service
命令:
sudo service apache2 start
- 使用
/etc/init.d
脚本:
sudo /etc/init.d/apache2 start