当前位置:首页 > 编程笔记 > 正文
已解决

【httpd】 Apache http服务器目录显示不全解决

来自网友在路上 157857提问 提问时间:2023-10-28 07:53:05阅读次数: 57

最佳答案 问答题库578位专家为你答疑解惑

文章目录

  • 1. 文件名过长问题
    • 1.1 在centos中文件所谓位置etc/httpd/conf.d/httpd-autoindex.conf
    • 1.2 在配置文件httpd-autoindex.conf中的修改:
    • 1.3 修改完成后重启Apache:

1. 文件名过长问题

在这里插入图片描述

1.1 在centos中文件所谓位置etc/httpd/conf.d/httpd-autoindex.conf

可通过find查找文件所在位置

find / -name httpd-autoindex.conf

1.2 在配置文件httpd-autoindex.conf中的修改:

IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* FoldersFirst Charset=UTF-8 SuppressDescription SuppressHTMLPreamble

其中

FancyIndexing 支持美化显示;

HTMLTable 允许底层代码把文件列表生成在一个table元素里面;

VersionSort 安装版本排序;

NameWidth=* 页面自动匹配文件名宽度;

FoldersFirst 安装文件夹优先排列;

Charset=UTF-8 支持中文显示;

SuppressDescription 不显示文件描述;

1.3 修改完成后重启Apache:

命令:

service httpd restart

重启时遇到报错问题

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

解决办法:

先卸载httpd和mod_wsgi

yum remove httpd mod_wsgi

重新安装:

yum -y install httpd mod_wsgi 

重新安装完成后,上面的配置还要再来一次,然后重启就成功了。

在配置文件httpd-autoindex.conf中的修改:

IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* FoldersFirst Charset=UTF-8 SuppressDescription SuppressHTMLPreamble

参考:
https://blog.csdn.net/yinshuilan/article/details/124814096

查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"【httpd】 Apache http服务器目录显示不全解决":http://eshow365.cn/6-26624-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!