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

相关推荐
好奇的菜鸟15 小时前
使用 Apache Flink CDC 3.0 实现 MySQL 到 Elasticsearch 的数据同步
mysql·flink·apache
byte轻骑兵2 天前
大数据时代时序数据库选型指南:深度解析与 Apache IoTDB 实践
大数据·apache·时序数据库
cloudcruiser2 天前
Apache HTTP Server:深入探索Web世界的磐石基石!!!
前端·其他·http·apache
奔跑草-3 天前
【服务器】Apache Superset功能、部署与体验
运维·服务器·apache·powerbi·superset
猫头虎4 天前
开源协议区别与限制详解:Fork、改名、再发布是否合法?(MIT、Apache、GPL、BSD、SSPL、BSL)
git·开源·github·apache·开源软件·开源协议·gitcode
yw00yw4 天前
小程序插件使用
java·小程序·apache
一个天蝎座 白勺 程序猿6 天前
Apache IoTDB(4):深度解析时序数据库 IoTDB 在Kubernetes 集群中的部署与实践指南
数据库·深度学习·kubernetes·apache·时序数据库·iotdb
喂完待续6 天前
【Tech Arch】Spark为何成为大数据引擎之王
大数据·hadoop·python·数据分析·spark·apache·mapreduce
Koma_zhe6 天前
【本地部署问答软件Apache Answer】Answer开源平台搭建:cpolar内网穿透服务助力全球用户社区构建
开源·apache