0 反对 收藏 我有一个 EFS 文件系统,它被挂载到多个 EC2 实例上。我正在尝试更改 apache 配置文件。我不希望我的 index.html 位于 EC2 实例硬盘上。相反,我想将它移动到我的 EFS 目录中,因此我尝试修改 httpd.conf,如下所示:
#<Directory "/var/www"> This is the original location on EC2 instance
<Directory "/home/ec2-user/efs"> my new location on EFS
AllowOverride None
# Allow open access:
Require all granted
</Directory>
#<Directory "/var/www/html"> This is the original location on EC2 instance
<Directory "/home/ec2-user/efs/files"> my new location on EFS
#
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.php modified file
</IfModule>
我所做的唯一修改是在 <<"Directory">> 元素中,我更改了 EFS 文件系统的路径。之后我重新启动了我的 Apache 服务器,但在加载我的网页时收到以下错误“您无权访问此服务器上的 /”。任何帮助都将不胜感激