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.htmlThis is a https page
(3)
创建配置文件并配置
vim / etc / httpd / conf.d / myssl.conf< Directory "/www/https" >AllowOverride NoneRequire 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
![](https://img-blog.csdnimg.cn/2ed7e7c0e44d43e9afa3e5e29d636284.png)
三、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 软件
完成自动挂载