在 CentOS 中,您需要使用 httpd 服务来管理 Apache
打开终端。
输入以下命令以启动 Apache 服务:
sudo systemctl start httpd
sudo systemctl status httpd
如果服务正在运行,您将看到 “Active: active (running)” 的状态信息。
sudo systemctl enable httpd
现在,Apache 服务已经启动并运行在 CentOS 系统上。如果您需要对 Apache 进行配置,请编辑 /etc/httpd/conf/httpd.conf 文件。在进行更改后,请重新启动 Apache 服务以使更改生效:
sudo systemctl restart httpd