搭建加密自签名网站

加载mod_ssl认证模块

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

生成自签名证书

[root@localhost ~]#cd /etc/pki/tls/certs
[root@localhost certs]# openssl req -newkey rsa:4096 -nodes -sha256 -keyout ../private/openlab.key  -x509 -days 365 -out openlab.crt

在这里插入图片描述

虚拟主机标签中添加加密验证信息

[root@localhost ~]# vim /etc/httpd/conf.d/vhosts.conf

将下面代码写入:
在这里插入图片描述

创建配置文件对应目录资源

[root@localhost conf.d]# mkdir /ssl
[root@localhost conf.d]# echo this ilss private > /ssl/index.html

重启服务测试

[root@localhost conf.d]#systemctl restart httpd

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_64311421/article/details/130650318