①首先查看系统是否已安装apache服务,apache服务又别名httpd服务
命令:rpm -qa | grep httpd
或命令:rpm -ql httpd | grep service
②如果系统没有安装则安装之
命令:yum -y install httpd httpd-devel
③启动httpd服务
命令:systemctl start httpd.service
④使能httpd
命令:systemctl enable httpd
⑤打开防火墙的80端口
命令:firewall-cmd --add-service=http
命令:firewall-cmd --permanent --add-service=http
⑥在本地PC端通过浏览器访问linux主机,我的地址:http://192.168.1.129,
,浏览器显示如下,表示apache服务器安装和配置成功。
新闻热点
疑难解答