基于域名的网站

**

搭建一个基于https://www.zuoye.com:11111或者https://wwww.zuoye.com:11111访问的web网站,网站首页在/www/zuoye/,内容为homework。 注意:防火墙和selinux

**
(1)安装加密模块[[email protected] ~]# yum install mod_ssl -y
基于域名的网站
(2)安装自签名证书
[[email protected] ~]# cd /etc/pki/tls/certs/
[[email protected] certs]# make jiami.crt
基于域名的网站
基于域名的网站(3)创建网页文件根目录,并定义网页内容[[email protected] ~]# mkdir -p /www/zuoye/
[[email protected] ~]# echo wn homework >/www/zuoye/index.html
(4)定义基于不同端口来访问网站的配置文件[[email protected] ~]# vim /etc/httpd/conf.d/vhosts.conf
基于域名的网站
(5)修改Linux中的hosts配置文件

基于域名的网站
(6)查看防火墙和SELinux
基于域名的网站

(7)重启服务
[[email protected] certs]# systemctl restart httpd
Enter SSL pass phrase for www.zuoye.com:443 (RSA) : ******
基于域名的网站
测试
在Windows中hosts文件中添加域名解析:
192.168.150.150 www.zuoye.com wwww.zuoye.com
基于域名的网站
https://www.zuoye.com:11111/
https://wwww.zuoye.com:11111/
基于域名的网站
基于域名的网站