1、搭建一个通过网址https://www.openlab.com/money访问的缴费网站,网站内容为money
1.dnf install httpd -y---下载软件包
dnf install nginx -y
2. [root@localhost ~]# nmcli connection modify ens33 +ipv4.addresses 192.168.223.135/24
[root@localhost ~]# nmcli connection up ens33
新建ip地址,并启动3.[root@localhost ~]# mkdir /www/openlab/money
[root@localhost ~]# echo money > /www/openlab/money/index.html
5.[root@localhost certs]# openssl genrsa -out openlab.key
[root@localhost certs]# openssl req -utf8 -new -key https.key -x509 -days 100 -out openlab.crt
6.[root@localhost ~]# vim /etc/hosts---配置映射关系
7.[root@localhost ~]# setenforce 0---selinux启动
[root@localhost ~]# getenforce
Permissive
[root@localhost ~]# systemctl restart nginx----配置结束,重启服务
测试结果;
2、配置DNS的正向解析
1.[root@localhost ~]# dnf install bind -y----安装软件包
2.[root@localhost ~]# vim /etc/named.conf---编辑bind主配配文件
3.[root@localhost ~]# vim /var/named/named.baidu.com---编写正向解析文件资源记录
4.
[root@localhost ~]# systemctl disable firewalld --now----关闭防火墙
[root@localhost ~]# setenforce 0---启动selinux
[root@localhost ~]# getenforce---检查状态
Permissive
[root@localhost ~]# systemctl restart named----重启named服务
测试结果:
5.[root@localhost ~]# vim /etc/resolv.conf----修改域名解析服务器
6.ping 测试:
至此,搭建web服务器和DNS正向解析配置完成!