apache共享目录文件配置

httpd配置文件路径

/etc/httpd/conf/httpd.conf

配置单个节点

httpd中原本有一个配置

bash 复制代码
<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>

增加配置的目录

bash 复制代码
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html
    Alias /test "/xxx"
    Alias /reports "/xxx1"
    <Directory xxx>
        AllowOverride None
        Options Indexes FollowSymLinks
        Require all granted
    </Directory>
    <Directory xxx1>
        AllowOverride None
        Options Indexes FollowSymLinks
        Require 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中的修改:

bash 复制代码
IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* FoldersFirst Charset=UTF-8 SuppressDescription SuppressHTMLPreamble

其中

FancyIndexing 支持美化显示;

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

VersionSort 安装版本排序;

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

FoldersFirst 安装文件夹优先排列;

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

SuppressDescription 不显示文件描述;

重启

systemctl restart httpd

相关推荐
努力的lpp9 小时前
小迪安全第8天:基础入门-算法分析 & 传输加密 & 数据格式 & 密文存储 & 代码混淆 & 逆向保护
服务器·网络·apache
爱人间9 小时前
apache-tomcat-8.5.72启动控制台乱码解决方案
java·tomcat·apache
XDHCOM10 小时前
Apache Mesos科普,提升资源利用率与系统扩展性的开源平台
开源·apache
❀͜͡傀儡师10 小时前
使用 Docker Run 部署 Apache WebDAV 服务
docker·apache·webdav
D愿你归来仍是少年10 小时前
Apache Spark 详细讲解第 7 章:Shuffle 机制深度解析
大数据·spark·apache
莫爷1 天前
JSON 性能优化实战:大数据量 JSON 的处理技巧
性能优化·json·apache
D愿你归来仍是少年1 天前
Flink 并行度变更时 RocksDB 状态迁移的关键机制与原理
大数据·flink·apache
User_芊芊君子1 天前
大数据时代时序数据库选型指南:Apache IoTDB技术解析与实践建议
大数据·apache·时序数据库
SeaTunnel1 天前
Apache SeaTunnel 提速不难,JVM 参数这样调
jvm·apache
小马爱打代码1 天前
Apache HttpClient 核心设计模式详解
设计模式·apache