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

文章目录

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

1. 文件名过长问题

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

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

shell 复制代码
find / -name httpd-autoindex.conf

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

shell 复制代码
IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* FoldersFirst Charset=UTF-8 SuppressDescription SuppressHTMLPreamble

其中

FancyIndexing 支持美化显示;

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

VersionSort 安装版本排序;

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

FoldersFirst 安装文件夹优先排列;

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

SuppressDescription 不显示文件描述;

1.3 修改完成后重启Apache:

命令:

shell 复制代码
service httpd restart

重启时遇到报错问题

shell 复制代码
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

shell 复制代码
yum remove httpd mod_wsgi

重新安装:

shell 复制代码
yum -y install httpd mod_wsgi 

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

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

shell 复制代码
IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* FoldersFirst Charset=UTF-8 SuppressDescription SuppressHTMLPreamble

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

相关推荐
游戏开发爱好者84 小时前
iOS重构期调试实战:架构升级中的性能与数据保障策略
websocket·网络协议·tcp/ip·http·网络安全·https·udp
(:满天星:)7 小时前
第31篇:块设备与字符设备管理深度解析(基于OpenEuler 24.03)
linux·运维·服务器·网络·centos
小陶来咯7 小时前
【仿muduo库实现并发服务器】Acceptor模块
运维·服务器
爱莉希雅&&&7 小时前
shell编程之awk命令详解
linux·服务器·git
笑稀了的野生俊7 小时前
在服务器中下载 HuggingFace 模型:终极指南
linux·服务器·python·bash·gpu算力
小扎仙森9 小时前
关于服务器宝塔转移wordperss子比主题问题
运维·服务器
小小小糖果人9 小时前
Linux云计算基础篇(5)
linux·运维·服务器
KENYCHEN奉孝9 小时前
Rust征服字节跳动:高并发服务器实战
服务器·开发语言·rust
开开心心就好10 小时前
免费PDF处理软件,支持多种操作
运维·服务器·前端·spring boot·智能手机·pdf·电脑
IC 见路不走11 小时前
LeetCode 第91题:解码方法
linux·运维·服务器