【httpd】 Apache http服务器目录显示不全解决

编程入门 行业动态 更新时间:2024-10-22 11:24:16

【httpd】 Apache http服务器目录显示<a href=https://www.elefans.com/category/jswz/34/1758894.html style=不全解决"/>

【httpd】 Apache http服务器目录显示不全解决

文章目录

  • 1. 文件名过长问题
    • 1.1 在centos中文件所谓位置etc/httpd/conf.d/httpd-autoindex.conf
    • 1.2 在配置文件httpd-autoindex.conf中的修改:
    • 1.3 修改完成后重启Apache:

1. 文件名过长问题

1.1 在centos中文件所谓位置etc/httpd/conf.d/httpd-autoindex.conf

可通过find查找文件所在位置

find / -name httpd-autoindex.conf

1.2 在配置文件httpd-autoindex.conf中的修改:

IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* FoldersFirst Charset=UTF-8 SuppressDescription SuppressHTMLPreamble

其中

FancyIndexing 支持美化显示;

HTMLTable 允许底层代码把文件列表生成在一个table元素里面;

VersionSort 安装版本排序;

NameWidth=* 页面自动匹配文件名宽度;

FoldersFirst 安装文件夹优先排列;

Charset=UTF-8 支持中文显示;

SuppressDescription 不显示文件描述;

1.3 修改完成后重启Apache:

命令:

service httpd restart

重启时遇到报错问题

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

yum remove httpd mod_wsgi

重新安装:

yum -y install httpd mod_wsgi 

重新安装完成后,上面的配置还要再来一次,然后重启就成功了。

在配置文件httpd-autoindex.conf中的修改:

IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* FoldersFirst Charset=UTF-8 SuppressDescription SuppressHTMLPreamble

参考:

更多推荐

【httpd】 Apache http服务器目录显示不全解决

本文发布于:2023-12-03 09:29:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1653772.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不全   服务器   目录   httpd   Apache

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!