rhce第二次作业

1、搭建一个通过网址https://www.openlab.com/money访问的缴费网站,网站内容为mone
[root@rhce ~]# mkdir -pv /www/https/money
[root@rhce ~]# echo money > /www/https/money/index.html
[root@rhce ~]cd /etc/pki/tls/certs/
[root@rhce certs]# openssl  genrsa -out  https.key        
Generating RSA private key, 2048 bit long modulus (2 primes)
...............+++++
..........................................+++++
e is 65537 (0x010001)
[root@rhce certs]# openssl req -utf8 -new -key https.key -x509 -days 100 -out https.crt        You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:
[root@rhce ~]# vim /etc/nginx/conf.d/money.conf
server {
        listen 192.168.126.156:443 ssl;
        server_name www.openlab.com;
        root /www/https;
        ssl_certificate /etc/pki/tls/certs/https.crt;
        ssl_certificate_key /etc/pki/tls/certs/https.key;
        location /money {
                index index.html;
        }
}
[root@rhce ~]# vim /etc/hosts
192.168.126.156 www.openlab.com
[root@rhce ~]# systemctl restart nginx
[root@rhce ~]# systemctl disable --now firewalld
[root@rhce ~]# setenforce 0
[root@rhce ~]# curl --insecure https://www.openlab.com/money/
Money

 2、配置DNS的正向解析

[root@localhost ~]# vim /etc/named.conf
options {
        listen-on port 53 { 192.168.126.133; };
        directory       "/var/named";
};
zone "ceshi.com" IN {
                type master;
                file "named.ceshi.com";
};
[root@localhost ~]# vim /var/named/named.ceshi.com
$TTL 1D
@       IN SOA @ admin.baidu.com. ( 0 1D 1H 1W 3H )
        IN NS ns.ceshi.com.
ns      IN A 192.168.126.133
www     IN A 192.168.126.133
[root@localhost ~]# systemctl restart named
[root@localhost ~]# systemctl disable firewalld --now
[root@localhost ~]# setenforce 0
[root@localhost ~]# nslookup www.ceshi.com 192.168.126.133
Server:         192.168.126.133
Address:        192.168.126.133#53
 
Name:   www.ceshi.com
Address: 192.168.126.133

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值