RHCE作业

1.基于域名[www.openlab.com](http://www.openlab.com)可以访问网站内容为welcome to openlab!!!

2.配置访问https网站
3.配置nfs自动挂载

一、基于域名访问网站

首先在windows中打开hosts文件,并且在末尾追加域名对应的ip地址

192.168.87.6  www.openlab.com

然后再 vim /etc/httpd/conf.d/myhosts.conf文件下追加SeverName www.openlab.com

重启服务 systemctl restart httpd

然后就可以使用域名www.openlab.com访问了

二、配置https静态网站

1.配置https需要一个支持ssl的模块的:mod_ssl

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

查看有conf.d文件存在

 2.打开ssl.conf

[ root @localhost ~ ]# grep -Ev '^#|^$' /etc/httpd/conf.d/ssl.conf
整个 ssl 工作流程中需要我们提供哪些东西:服务器的证书,服务器的私钥

 3.重启服务

[root@localhost ~]# systemctl restart httpd

4.

(1)配置SSL

nmcli c modify ens160 +ipv4.addresses 192.168.87.8/24  添加一个网址
(2)创建一个网站目录和添加首页文件
[ root @localhost ~ ]# mkdir /www/https
[ root @localhost ~ ]# echo "This is a https page" > /www/https/hello.html
[ root @localhost ~ ]# cat /www/https/hello.html
This is a https page
(3) 创建配置文件并配置
vim / etc / httpd / conf.d / myssl.conf
< Directory "/www/https" >
AllowOverride None
Require all granted
</ Directory >
< VirtualHost 192.168.87.8 : 443 >
SSLEngine on
#SSLProtocol all -SSLv3
# 加密套件
SSLCipherSuite PROFILE = SYSTEM
# 证书
SSLCertificateFile / etc / pki / tls / certs / localhost.crt
# 私钥
SSLCertificateKeyFile / etc / pki / tls / private / localhost.key
# 网站内容目录
DocumentRoot "/www/https" </ VirtualHost >
(4)重启服务并验证
systemctl restart httpd

 

三、nfs自动挂载
配置 yum install nfs - utils - y
yum install nfs-utils -y
配置rpcbind
yum install rpcbind -y
创建共享文件mkdir /sharedata
编辑配置文件vim /etc/exports
/sharedata 192.168.87.10/24 (rw)
启动服务 两者顺序不能改变

systemctl restart rpcbind

systemctl restart nfs-server.service

在另一台客户机上配置挂载点mkdir /localdata

客户端安装yum install autofs -y  软件

完成自动挂载

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值