红帽6/7:ip/manual/howto/access.htmlip/manual/mod/mod_access-compat.html![](http://139.199.161.77/linhut/201782_files/Image [1].png)首先他需要一个容器可以从 /etc/httpd/conf/httpd.conf拷贝一个容器****红帽5/6![](http://139.199.161.77/linhut/201782_files/Image [2].png)Orader allow,deny          就是允许所有Allow form all             允许所有人Allow form 192.168.0.0/24  这是指允许这个网段访问Allow from example.com     允许这个于中的可以访问Allow from 192.168.0.19    允许这个ip访问Orader deny,allow          拒绝所有人Deny from 192.168.0.19     拒绝这个ip访问 红帽7:![](http://139.199.161.77/linhut/201782_files/Image [3].png)这里也需要Directory容器![](http://139.199.161.77/linhut/201782_files/Image [4].png)Require all granted         允许所有Require all denied          拒绝所有Require ip  xxxxxxx         允许ip限制Require host xxxxxx         允许host限制Require 为肯定语句(拒绝所有,允许单个)再套一层容器,做更加好的判断![](http://139.199.161.77/linhut/201782_files/Image [5].png)这个容器是允许所有,拒绝单个Require all granted                允许所有Require not ip xxxxx               拒绝ipRequire not host xxxxx           拒绝host ![](http://139.199.161.77/linhut/201782_files/Image [6].png)对baidu下的子目录lmf做容器限制 域名跳转(网页跳域名)![](http://139.199.161.77/linhut/201782_files/Image [7].png) www.redhat.com ––> www.redhat.cn 协议跳协议SSL(安全套接次层)【443端口】yum install mod_ssl -y        #会在conf.d下有一个ssl.conf这是一个ssl模块![](http://139.199.161.77/linhut/201782_files/Image [8].png) 上面是http下面的是https,详细可以看手册ip/manual/mod/mod_access-compat.html ./conf.d/ssl.conf![](http://139.199.161.77/linhut/201782_files/Image [9].png)![](http://139.199.161.77/linhut/201782_files/Image [10].png)CA证书 做证书的地方(自签名)![](http://139.199.161.77/linhut/201782_files/Image [11].png)新建一个证书![](http://139.199.161.77/linhut/201782_files/Image [12].png)然后打开域名,添加证书![](http://139.199.161.77/linhut/201782_files/Image [13].png) 访问控制加上协议跳转:![](http://139.199.161.77/linhut/201782_files/Image [14].png)这里是做了协议跳转并在https的虚拟主机上做访问控制 动态网页wsgi模块需要安装模块支持yum searh mod_wsgi     #查找包名yum insyall mod_wgi      #安装模块![](http://139.199.161.77/linhut/201782_files/Image [15].png)使用python编写的![](http://139.199.161.77/linhut/201782_files/Image [16].png)如果修改端口,需要添加一个Listen 端口,然后应该conf配置文件都可以![](http://139.199.161.77/linhut/201782_files/Image [17].png)添加selinux的目的 如果修改了端口,而且开启了防火墙需要添加端口通过![](http://139.199.161.77/linhut/201782_files/Image [18].png) 问题:![](http://139.199.161.77/linhut/201782_files/Image [19].png)自发证书名字锁定,日志错误编码:0B080074是因为证书在生成的时候会记录你主机的信息,包括你的配置文件名,所以当修改了配置文件名就会导致这个问题。解决方法:重新签发一个证书,记录新的主机信息就可以解决这个问题。

视频分享

链接: https://pan.baidu.com/s/1c2TtIQO 密码: e3jz