/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
?