【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

相关推荐
稳联技术老娜5 小时前
DeviceNet主站怎么连接西门子PLC,Profinet网关配置手册(那智机器人)
服务器·网络·数据库
9分钟带帽6 小时前
linux_系统开机自动执行shell脚本
linux·服务器
消失在人海中7 小时前
oracle 数据库多表关联查询
服务器·数据库·oracle
嵌入式小能手8 小时前
飞凌嵌入式ElfBoard-进程间的通信之命名管道
linux·服务器·算法
荒--9 小时前
apt dpkg 命令详解
linux·服务器
LIZHUOLONG111 小时前
linux 设备初始化
linux·运维·服务器
遇印记11 小时前
软考知识点(局域网基础)
运维·服务器·局域网
難釋懷11 小时前
Nginx-CA 签名
服务器·nginx·ssl
ylscode11 小时前
Linux CIFSwitch 内核新漏洞允许攻击者获得 root 权限
linux·运维·服务器
TYKJ02312 小时前
租GPU服务器前必须确认的5个隐藏成本
服务器·后端·ai编程