在 CentOS 系统中,您可以使用以下命令来启动 Apache 服务:
打开终端。
输入以下命令以启动 Apache 服务:
sudo systemctl start httpd
sudo systemctl status httpd
如果 Apache 服务已成功启动,您将看到类似于以下的输出:
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since ...
现在,Apache 服务已经在 CentOS 上启动并运行。如果您想要让 Apache 服务在系统启动时自动运行,请使用以下命令:
sudo systemctl enable httpd
如果您想要停止 Apache 服务,可以使用以下命令:
sudo systemctl stop httpd