【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

相关推荐
醉风塘15 小时前
Linux进程管理:深度解析ps -ef命令及其高级应用
linux·运维·服务器
WJ.Polar15 小时前
FTP、Telnet、PPP、SNMP协议
服务器·网络
BLSxiaopanlaile15 小时前
《凤凰架构-构建可靠的大型分布式系统》读书笔记 -关于网络通信安全性的一些总结
http·加密·认证授权·网络通信安全
REDcker15 小时前
gRPC完整文档
服务器·网络·c++·网络协议·grpc
Highcharts.js15 小时前
如何设置自定义Highcharts导出服务器?
服务器·highcharts·自定义导出·导出服务器·导出模块·渲染功能
江湖有缘16 小时前
基于华为openEuler系统部署Gitblit服务器
运维·服务器·华为
yuanmenghao16 小时前
Linux 性能实战 | 第 10 篇 CPU 缓存与内存访问延迟
linux·服务器·缓存·性能优化·自动驾驶·unix
QT.qtqtqtqtqt16 小时前
SQL注入漏洞
java·服务器·sql·安全
qq_54702617916 小时前
LangChain 1.0 核心概念
运维·服务器·langchain
晚霞的不甘16 小时前
Flutter for OpenHarmony 打造沉浸式呼吸引导应用:用动画疗愈身心
服务器·网络·flutter·架构·区块链