在 Debian 系统中,Apache 服务通常叫 apache2,重启方式有以下几种:
sudo systemctl restart apache2
如果只是重新加载配置(不中断服务):
sudo systemctl reload apache2
查看状态:
sudo systemctl status apache2
sudo service apache2 restart
sudo apache2ctl restart
或重新加载配置:
sudo apache2ctl graceful
sudo /etc/init.d/apache2 restart
常见说明
sudo apache2ctl configtest
Permission denied,记得加 sudo 或使用 root 用户。如果你用的是 Debian + Apache + PHP / 宝塔 / Docker 等环境,也可以告诉我,我可以给你更具体的方式。