RHCE-3

1、搭建一个基于https://www.zuoye.com:4443访问的web网站,网站首页在/www/https/,内容为zuoye

首先添加一个新的ip地址:

[root@NumTow ~]# nmcli connection modify ens160 +ipv4.addresses 192.168.74.120/24
[root@NumTow ~]# nmcli connection up ens160

 安装ssl服务

[root@localhost ~]# yum install mod_ssl -y

创建服务器私钥和ca证书

[root@localhost ~]# openssl genrsa >private.key     #创建服务器私钥

[root@NumTow certs]# openssl req -utf8 -new -key private.key -x509 -days 365 -out ca.crt -set_serial 0                       #创建ca证书   
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) [XX]:86
State or Province Name (full name) []:shannxi
Locality Name (eg, city) [Default City]:xian
Organization Name (eg, company) [Default Company Ltd]:op
Organizational Unit Name (eg, section) []:ce
Common Name (eg, your name or your server's hostname) []:www.zuoye.com
Email Address []:admin@https.com

配置子文件/etc/httpd/conf.d/https.conf

Listen 4443
<VirtualHost 192.168.126.120:4443>
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/ca.crt
    SSLCertificateKeyFile /etc/pki/tls/certs/private.key
    DocumentRoot /www/https
    ServerName www.zuoye.com
</VirtualHost>
<Directory /www/https>
        AllowOverride none
        Require all granted
</Directory>

创建访问目录/www/https/index.html 内容为zuye
重启服务,访问测试

2、搭建时间服务器,客户端可从ntp服务器更新自己的时间。

 安装包

[root@NumTow https]# yum install chrony -y    

配置服务器端的配置文件/etc/chrony.conf

# Allow NTP client access from local network.
allow 192.168.74.0/24    #准许那个网段的主机访问

# Serve time even if not synchronized to a time source.
local stratum 13

服务器端重启服务

[root@NumTow certs]# systemctl restart chronyd

客户端配置文件并重启服务,向服务器端请求同步时间
 

#Please consider joining the pool (http://www.pool.ntp.org/join.html).

pool 192.168.74.225 iburst
[root@NumOne ~]# systemctl restart chronyd

[root@NumOne ~]# chronyc sources

MS Name/IP address         Stratum Poll Reach LastRx Last sample

^* 192.168.74.225                2   6    17    31   -384us[  -21ms] +/-   36ms

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值