安装软件
[root@server_1 ~]# yum install httpd\* -y
编辑配置文件
默认测试静态页面不需要编辑主配置文件
编辑index.html的内容
[root@server_1 ~]# echo hello world! > /var/www/html/index.html
配置selinux
[root@server_1 ~]# vim /etc/selinux/config
SELINUX=enforcing
[root@server_1 ~]# setenforce 1
[root@server_1 ~]# getenforce
Enforcing
配置防火墙
放行http服务
[root@server_1 ~]# firewall-cmd --add-service=http --per
放行80端口
[root@server_1 ~]# firewall-cmd --add-port=80/tcp --per
开机自动启动httpd服务
[root@server_1 ~]# systemctl enable httpd
重启httpd服务
[root@server_1 ~]# systemctl restart httpd
重启防火墙
[root@server_1 ~]# systemctl restart firewalld
客户端测试
[root@server_2 ~]# curl 192.168.19.101
hello world!