1.修改配置文件
打开配置文件修改server区域添加autoindex on参数,注释默认文档类型
autoindex on;

2.修改默认文件名
将目录下的index.html文件删除或重命名为其他,因为浏览器默认读取index.html
[root@localhost html]# mv index.html index.html.txt
[root@localhost html]# ls
50x.html index.html.txt test test.txt
3.创建默认文件
[root@localhost html]# mkdir hello
[root@localhost html]# ls
50x.html hello index.html.txt test test.txt
[root@localhost html]#
4.访问验证

文章详细介绍了如何修改HTTP服务器的配置,包括在server区域启用autoindexon参数以显示目录索引,移除或重命名默认的index.html文件,以及创建一个新的默认文件夹hello,以改变浏览器的默认访问行为。
1524

被折叠的 条评论
为什么被折叠?



