cent系统可以直接使用yum安装:
yum install httpd
安装后要打开服务:
systemctl enable httpd
systenctl start httpd
同时要打开http和https端口,分别是80和443:
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
停止http服务器:
systemctl stop httpd
重启http服务器:
systemctl restart httpd
配置更改后重新加载配置:
systemctl reload httpd