在Ubuntu中,可以使用systemctl
命令来启用或禁用服务。以下是在Ubuntu中启用/禁用服务的步骤:
sudo systemctl enable <service_name>
例如,要启用Apache Web服务器服务:
sudo systemctl enable apache2
sudo systemctl disable <service_name>
例如,要禁用Apache Web服务器服务:
sudo systemctl disable apache2
sudo systemctl daemon-reload
systemctl status <service_name>
例如,要检查Apache Web服务器服务的状态:
systemctl status apache2