linux系统—apache的网页重载

创建默认发布目录以及发布文件

新建目录 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

在这里插入图片描述

  • 编辑发布文件
  • cd /etc/httpd/conf.d

在这里插入图片描述

重起服务  [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 进行访问 会自动重写成 https://login.westos.com/

第一次需要添加证书

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/liuchuang11/article/details/89892806