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.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

配置完成保存

重启

 systemctl restart httpd
 

相关推荐

  1. apache共享目录文件配置

    2024-01-10 07:54:01       62 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-10 07:54:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-10 07:54:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-10 07:54:01       87 阅读
  4. Python语言-面向对象

    2024-01-10 07:54:01       96 阅读

热门阅读

  1. 【困难】42. 接雨水

    2024-01-10 07:54:01       54 阅读
  2. MySQL面试系列-02

    2024-01-10 07:54:01       54 阅读
  3. 数据分析---SQL

    2024-01-10 07:54:01       59 阅读
  4. 【Web】 CSS引用方式

    2024-01-10 07:54:01       55 阅读
  5. 数学之何为数学

    2024-01-10 07:54:01       52 阅读
  6. Python中的科学计算和数学建模

    2024-01-10 07:54:01       62 阅读