【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

相关推荐
搬码临时工2 小时前
电脑同时连接内网和外网的方法,附外网连接局域网的操作设置
运维·服务器·网络
程序猿小D3 小时前
第16节 Node.js 文件系统
linux·服务器·前端·node.js·编辑器·vim
midsummer_woo4 小时前
【2025年】解决Burpsuite抓不到https包的问题
网络协议·http·https
IT界小黑的对象6 小时前
virtualBox部署ubuntu22.04虚拟机 NAT+host only 宿主机ping不通虚拟机
linux·运维·服务器
我是唐青枫6 小时前
.NET AOT 详解
java·服务器·.net
藥瓿亭7 小时前
K8S认证|CKS题库+答案| 4. RBAC - RoleBinding
linux·运维·服务器·云原生·容器·kubernetes·cks
本郡主是喵8 小时前
并发编程 - go版
java·服务器·开发语言
stormsha8 小时前
Proxmox Mail Gateway安装指南:从零开始配置高效邮件过滤系统
服务器·网络·网络安全·gateway
itachi-uchiha8 小时前
命令行以TLS/SSL显式加密方式访问FTP服务器
服务器·网络协议·ssl
二进制coder8 小时前
服务器健康摩尔斯电码:深度解读S0-S5状态指示灯
运维·服务器