当前位置: 首页 > news >正文

apache共享目录文件配置

httpd配置文件路径

/etc/httpd/conf/httpd.conf

配置单个节点

httpd中原本有一个配置

<Directory "/var/www">AllowOverride None# Allow open access:Require all granted
</Directory># Further relax access to the default document root:
<Directory "/var/www/html">## Possible values for the Options directive are "None", "All",# or any combination of:#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews## Note that "MultiViews" must be named *explicitly* --- "Options All"# doesn't give it to you.## The Options directive is both complicated and important.  Please see# http://httpd.apache.org/docs/2.4/mod/core.html#options# for more information.#Options Indexes FollowSymLinks## AllowOverride controls what directives may be placed in .htaccess files.# It can be "All", "None", or any combination of the keywords:#   Options FileInfo AuthConfig Limit#AllowOverride None## Controls who can get stuff from this server.#Require all granted
</Directory>

增加配置的目录

# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>DirectoryIndex index.htmlAlias /test "/xxx"Alias /reports "/xxx1"<Directory xxx>AllowOverride NoneOptions Indexes FollowSymLinksRequire all granted</Directory><Directory xxx1>AllowOverride NoneOptions Indexes FollowSymLinksRequire all granted</Directory>
</IfModule>

其中xxx是指本地的某个绝对路径映射到http://localhost/test

xxx1是指本地的某个绝对路径映射到http://localhost/reports

配置完成保存

文件名长度配置

httpd apache index 显示文件名长度 

通常情况下,文件名过长,打开index后,过长的文件名会最后会显示..

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

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

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

其中

FancyIndexing 支持美化显示;

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

VersionSort 安装版本排序;

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

FoldersFirst 安装文件夹优先排列;

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

SuppressDescription 不显示文件描述;

重启

 systemctl restart httpd
 

http://www.lryc.cn/news/278835.html

相关文章:

  • kotlin take 和 drop
  • SQL-DML增删改
  • 雷达信号处理——恒虚警检测(CFAR)
  • k8s的yaml文件中的kind类型都有哪些?(详述版Part1/2)
  • 企业培训系统源码:构建智能、可扩展的学习平台
  • 设计模式—行为型模式之状态模式
  • Linux习题3
  • SpringBoot+策略模式实现多种文件存储模式
  • 细说DMD芯片信号-DLP3
  • MySQL从0到1全教程【1】MySQL数据库的基本概念以及MySQL8.0版本的部署
  • grep常用命令
  • Spring Data JPA 使用总结
  • 融云 CEO 董晗荣获 51CTO 「2023 年度科技影响力人物奖」
  • 数据洞察力,驱动企业财务变革
  • Postgresql常见(花式)操作完全示例
  • 【Docker】数据管理
  • 认识异常及异常处理机制之try-catch
  • html学习之路:简述html文档头部 <meta> 的 http-equiv 属性
  • 逆矩阵计算
  • 《豫鄂烽火燎原大小焕岭》:一部穿越时空的历史史诗
  • 浅研究下 DHCP 和 chrony
  • 【算法】动态中位数(对顶堆)
  • mysql服务多实例运行
  • 「HDLBits题解」Module fadd
  • 微软等开源评估ChatGPT、Phi、Llma等,统一测试平台
  • DDNS-GO配置使用教程
  • flex弹性盒子常用的布局属性详解
  • 2023年Gartner® DevOps平台魔力象限发布,Atlassian被评为“领导者”
  • kylin集群使用nginx反向代理
  • 小红书搜索团队提出全新框架:验证负样本对大模型蒸馏的价值