创建默认发布目录以及发布文件
新建目录 mkdir /web_dos/login/html/ -p
编辑发布文件内容 vim index.html
welcome to xi'an
[root@server ~]# mkdir -p /web_dos/login/html/
[root@server /]# cd web_dos/login/html/
[root@server html]# cat index.html
<h1>welcome to xi'an</h1>
添加域名解析
[root@server html]# vim /etc/hosts
重起服务 [root@server conf.d]# systemctl restart httpd.service
第一次测试:
是不会出现的自己在测试端编写的内容的,而是会出现原本“80”端口的原发布文件,因为此时访问的端口时“端口",而不是”433“端口,所以要在编辑文件内容,访问”80“端口的时候,会直接访问443端口
[root@server conf.d]# vim login.conf
[root@server conf.d]# systemctl restart httpd.service
^(/.*)$ #客户在浏览器地址中输入的所有字符
https:// #强制客户加密访问
%{HTTP_HOST} #客户请求主机
$1 #“1”表示(/.*)的值
[redirect=301] #永久转换301;临时重写 302
- 测试端对在本地解析文件中对 login.westos.com 进行解析
使用 login.westos.com 进行访问 会自动重写成 https://login.westos.com/
第一次需要添加证书