【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

相关推荐
华允物联-HUAIOT1 小时前
串口路由器是什么?带串口的工业联网设备科普
服务器
菜鸟学编程o1 小时前
Linux常见指令
linux·运维·服务器
小此方3 小时前
Linux网络(十二):HTTP短连接与长连接:从Connection机制到Cookie、Session,彻底理解HTTP的无状态
服务器·网络·http
千舟软件4 小时前
【宿舍管理小程序】新生入住不靠纸质表
大数据·运维·服务器·科技·业界资讯
江畔柳前堤4 小时前
On-Policy Distillation 全景深潜
人工智能·网络协议·目标检测·http·机器学习·chatgpt·重构
The Chosen One9856 小时前
OS第二章随手记(2.1)
linux·运维·服务器·笔记
吠品7 小时前
纯HTML+ECharts构建交互式数据看板:实现思路与踩坑记录
java·服务器·数据库
青峰客7 小时前
DeepSeek 大模型新手快速上手指南
运维·服务器·github
程序员-Benothing7 小时前
Linux查找文件命令:find、locate、which、whereis实战
linux·运维·服务器
团子股股东峥哥7 小时前
day39-RHEL-访问网络附加存储
linux·运维·服务器