停止服务:
使用系统自带的service命令停止服务,如:sudo service apache2 stop使用systemctl命令停止服务,如:sudo systemctl stop apache2重启服务:
使用系统自带的service命令重启服务,如:sudo service apache2 restart使用systemctl命令重启服务,如:sudo systemctl restart apache2注意事项:
在停止或重启服务时,需要有足够的权限,一般需要使用sudo或者root用户进行操作在重启服务之前,建议先停止服务再重新启动,以确保服务能够正常重启如果服务出现异常或者无法停止或重启,可以尝试使用强制停止或重启的方式,如:sudo service apache2 force-stop 或 sudo service apache2 force-restart

