在 CentOS 中检查 Apache(通常服务名为 httpd)状态,常用方法如下:
systemctl status httpd
看到 active (running) 表示正在运行。
启动 / 停止 / 重启:
systemctl start httpd
systemctl stop httpd
systemctl restart httpd
service httpd status
ps -ef | grep httpd
或
pgrep httpd
ss -lntp | grep :80
或
netstat -lntp | grep :80
curl http://localhost
或浏览器访问服务器 IP。
tail -f /var/log/httpd/error_log
tail -f /var/log/httpd/access_log
如果你告诉我 CentOS 具体版本(6 / 7 / 8 / Stream),我可以给你更精确的建议。