網站首頁 編程語言 正文
前言
此實驗準備兩臺虛擬機便于調試,一臺CentOs6,一臺紅帽6
1.首先確保yum倉的配置是否完好(CentOs6)
?2.要求在centOs6中安裝httpd和mod_ssl軟件包
[root@cento211 yum.repos.d]# yum -y install httpd mod_ssl
3.在CentOs6中啟用httpd.service并使其開機自啟
[root@cento211 ~]# systemctl enable httpd.service Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service. [root@cento211 ~]# systemctl start httpd.service
4.在web內容的開發者完成Web應用之前,使用Congratulation!來提供占位符頁面
[root@cento211 ~]# vim /var/www/html/index.html Congratulation!
查看應用web頁面的編輯內容
[root@cento211 ~]# cat /var/www/html/index.html Congratulation!
5.啟用和啟動firewalld服務
[root@cento211 ~]# systemctl is-enabled firewalld enabled
6.在CentOs6上的firewalld配置對所有未指定連接使用dmz區域
(1).首先看Firewalld的默認區域
[root@cento211 ~]# firewall-cmd --get-default public (是默認的public區域)
(2).使用dmz區域
[root@cento211 ~]# firewall-cmd --set-default-zone=dmz success
(3).查看此時的默認區域
[root@cento211 ~]# firewall-cmd --get-default dmz
7.打開兩臺虛擬機,分別查看虛擬機地址
8.來自子網10.1.1.0/24網段的流量路由到work區域
[root@cento211 ~]# firewall-cmd --permanent --add-source=10.1.1.0/24 --zone=work success
9.重置
[root@cento211 ~]# firewall-cmd --reload success
10.查看此時的source
[root@cento211 ~]# firewall-cmd --list-all --zone=work work (active) target: default icmp-block-inversion: no interfaces: sources: 10.1.1.0/24 (這個就是我們配置的地址) services: dhcpv6-client ssh ports: protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules:
11.work區域應打開Https需要的所有端口,并且對所有未加密的http流量進行過濾
(1).首先打開Https服務
[root@cento211 ~]# firewall-cmd --permanent --add-service=https --zone work success
(2).重置
[root@cento211 ~]# firewall-cmd --reload success
(3).查看此服務被啟用
12.在另一臺虛擬機紅帽6上查看yum倉是否完好
?
13.在紅帽6中使用curl 來對服務器進行測試,測試https://10.1.1.211
[root@centos6-212~]# curl -k https://10.1.1.211 Congratulation!
14.網頁測試
原文鏈接:https://blog.csdn.net/qq_63533962/article/details/121588867
相關推薦
- 2022-06-29 python打印經典故事從前有座山的幾種寫法_python
- 2023-11-13 linux平臺下ZeroMQ zmq(C++)編譯安裝以及調用
- 2022-11-29 redis配置文件詳解
- 2022-03-15 pycharm安裝opencv出現錯誤:Could not find a version that
- 2022-03-07 Go?container包的介紹_Golang
- 2022-10-21 C++?move?semantic移動語義介紹_C 語言
- 2022-05-24 SQL?Server表空間碎片化回收的實現_MsSql
- 2022-12-06 C#實現跑馬燈效果的示例代碼_C#教程
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支