【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

相关推荐
RisunJan9 分钟前
Linux命令-ngrep(方便的数据包匹配和显示工具)
linux·运维·服务器
.千余10 分钟前
【Linux】基本指令3
linux·服务器·开发语言·学习
热爱Liunx的丘丘人26 分钟前
Ansible-doc及常用模块
linux·运维·服务器·ansible
一生了无挂1 小时前
自己编译RustDesk,并将自建ID服务器和key信息写入客户端
运维·服务器
yngsqq3 小时前
编译的dll自动复制到指定目录并重命名
java·服务器·前端
聊点儿技术3 小时前
IP风险等级评估在保险承保中的三个核心应用场景——从投保核验到持续监控
服务器·金融·ip·保险·ip风险评估·ip风险等级·风险评估api
似水এ᭄往昔4 小时前
【Linux】--基础IO
linux·服务器
桌面运维家4 小时前
IDV云桌面vDisk机房课表联动部署方案
大数据·服务器·数据库
开开心心_Every4 小时前
扫描软件,部分文档文字表格识别功能可免费
运维·服务器·pdf·电脑·excel·3dsmax·houdini
陆伟峰(云固件作者)5 小时前
Linux Mint 22.3:给初学者的第一份 Linux 说明书
linux·运维·服务器