一,1.配置IP
[root@ntpserver ~]# nmcli connection modify ens33 +ipv4.addresses 192.168.208.156/24
[root@ntpserver ~]# nmcli connection up ens33
2.写入文件
[root@ntpserver ~]# mkdir -pv /www/https/money
[root@ntpserver ~]# echo money > /www/https/money/index.html
3.生成私钥和证书
生成私钥:
[root@ntpserver ~]# cd /etc/pki/tls/certs
[root@ntpserver certs]# openssl genrsa -out https.key
生成证书:
[root@ntpserver certs]# openssl req -utf8 -new -key https.key -x509 -days 100 -out https.crt
Country Name (2 letter code) [AU]:CN
State or Province Name (full name) [Some-State]:Shaanxi
Locality Name (eg, city) []:xi'an
Organization Name (eg, company) [Internet Widgits Pty Ltd]:opanlab
Organizational Unit Name (eg, section) []:rhce
Common Name (e.g. server FQDN or YOUR name) []:www.openlab.com
Email Address []:admin@openlab.com
4.编辑配置文件
[root@ntpserver certs]# vim /etc/nginx/conf.d/http.conf
重启服务:
[root@ntpserver certs]# systemctl restart nginx
5.验证
二,1.编写主配置文件
[root@ntpserver ~]# vim /etc/named.conf
2.编写正向解析文件
[root@ntpserver ~]# vim /var/named/named.baidu.com
关闭防火墙:
[root@ntpserver ~]# systemctl disable --now firewalld
重启服务:
[root@ntpserver ~]# systemctl restart named
测试: