在 CentOS 下,Apache 通常叫 httpd(而不是 apache2,apache2 是 Debian/Ubuntu 的叫法)。
# 重启
systemctl restart httpd
# 启动
systemctl start httpd
# 停止
systemctl stop httpd
# 查看状态
systemctl status httpd
service httpd restart
systemctl enable httpd
systemctl restart apache2
apachectl configtest
显示 Syntax OK 再重启。如果你是 Docker / 编译安装 / 特定面板(如宝塔),可以告诉我,我给你对应的重启方式。