У вас нет прав доступа к папке / папке на этом сервере — AWS EC2

Я знаю, что есть миллиард вопросов по этому поводу, но я не могу заставить его работать.

Что я сделал до сих пор:

  1. Измените мой файл httd.conf, чтобы DirectoryRoot был /home/ec2-user/folder,

  2. Перезапустил мой сервер apache.

  3. chmod -R 775 /home/ec2-user/folder

  4. Изменил мой httd.conf (здесь только измененные строки)

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#

#DocumentRoot "/var/www/html"DocumentRoot "/home/ec2-user/folder"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
#    Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
#    Allow from all
Require all granted
</Directory>

и тогда это:

# This should be changed to whatever you set DocumentRoot to.
#

#<Directory "/var/www/html">
<Directory "/home/ec2-user/folder">
#
# 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.2/mod/core.html#options
# for more information.
#
#  Options Indexes FollowSymLinks

Options Indexes FollowSymLinks Includes ExecCGI
#
# 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 All

#
# Controls who can get stuff from this server.
#
Order allow,deny
#   Allow from all
Require all granted
</Directory>

и тогда это:

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
#Listen 80
Listen 0.0.0.0:80

Но мне все еще отказано в разрешении на /file.php.

Что мне не хватает?

РЕДАКТИРОВАТЬ: Я также изменил DocumentRoot. До этого у меня была неправильная ссылка URL, теперь у меня нет разрешений. Итак, прямо сейчас, URL-адрес правильный, я просто не установил правильные разрешения для него.

1

Решение

Я не сделал ничего отличного от вышеописанного — но после перезапуска моего Apache и выхода из AWS несколько раз — тогда это волшебным образом сработало. Выполнив вышеуказанные шаги и проверив журналы на наличие ошибок, вы должны исправить это.

-1

Другие решения

Других решений пока нет …