Linux企业运维实战
丁敏 郑国华

1
2
3
4
5
6
7
8
9
10
11
12
13

任务2-配置Apache服务器

发布时间:2022-03-02 23:10   发布人:丁敏   浏览次数:429

2.2.2  子任务2  让防火墙放行,并设置SELinux为允许

(1)使用防火墙命令,放行http服务。

[root@RHEL7-1 ~]# firewall-cmd --list-all

[root@RHEL7-1 ~]# firewall-cmd --permanent --add-service=http

success 

[root@RHEL7-1 ~]# firewall-cmd --reload 

success 

[root@RHEL7-1 ~]# firewall-cmd --list-all upublic (active)

  target: default u  icmp-block-inversion: no

 interfaces: ens33 

 sources:

  services: ssh dhcpv6-client samba dns http

(2)更改当前的SELinux值为允许,

后面可以跟Enforcing、Permissive或者1、0。 

[root@RHEL7-1 ~]# getenforce uenforcing

[root@RHEL7-1 ~]# setenforce 0

[root@RHEL7-1 ~]# getenforce uPermissive

2.2.3  子任务3  测试httpd服务是否安装成功

[root@RHEL7-1 ~]# systemctl start httpd 

[root@RHEL7-1 ~]# systemctl enable httpd

[root@RHEL7-1 ~]# firefox https://127.0.0.1 

image.png