В соединении для развертывания сайта отказано для Laravel проекта, размещенного на экземпляре EC2 - PullRequest
0 голосов
/ 04 августа 2020

Я пытаюсь развернуть свой сайт с использованием Laravel на экземпляре AWS EC2 под управлением CentOS7. Я проверил, правильно ли установлены порты и настройки трафика c, так как я смог попасть на целевую страницу apache перед редактированием конфигурации, и я также могу ввести s sh и пинговать IP, но я считаю, что у меня, возможно, проблема с файлами конфигурации. Вот что я нажимаю, когда попадаю в конечную точку:

enter image description here

enter image description here

My httpd is running and I was able to access the apache landing page prior to editing my config files.

Here is the main part of my httpd.conf (please note: I didn't include the whole thing because it is massive and consists of mostly commented out code):

# 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/[project_path]/public"
#
# Relax access to content within /var/www.
#
 AllowOverride All # Разрешить открытый доступ: требовать все разрешено  # Далее ослабить доступ к документу по умолчанию root : # # Возможные значения для директивы Options: "None", "All" # или любая комбинация: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Обратите внимание, что "MultiViews" должны иметь имя * явно * --- "Options All" # вам этого не дает. # # Директива Options сложна и важна. Пожалуйста, смотрите # http://httpd.apache.org/docs/2.4/mod/core.html#options # для получения дополнительной информации. # Индексы опций FollowSymLinks # # AllowOverride контролирует, какие директивы могут быть помещены в файлы .htaccess. # Это может быть "Все", "Нет" или любая комбинация ключевых слов: # Параметры FileInfo AuthConfig Limit # AllowOverride All # # Управляет тем, кто может получать данные с этого сервера. # Требовать предоставления всех разрешений  # # DirectoryIndex: устанавливает файл, который Apache будет обслуживать, если будет запрошен каталог #. # DirectoryIndex index. html  # # Следующие строки предотвращают просмотр файлов .htaccess и .htpasswd # веб-клиентами. # Требовать все отклонено  

и вот мой добавленный файл project.conf внутри conf.d:

<Directory "/var/www/[project_path]/public">
  AllowOverride All
  # Allow open access:
  Require all granted
</Directory>
# Further relax access to the default document root:
<Directory "/var/www/[project_path]/public">
  #
  # 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 All
  #
  # Controls who can get stuff from this server.
  #
  Require all granted
</Directory>
<Directory "/var/www/[project_path]/public">
        Options -Indexes
</Directory>
<VirtualHost hostIP:80>
        ServerName hostIP
        DocumentRoot /var/www/[project_path]/public
        TraceEnable Off
</VirtualHost>
ServerTokens Prod
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
<IfModule mpm_prefork_module>
    StartServers      50
    MinSpareServers     10
    MaxSpareServers     30
        ServerLimit       50
        MaxClients       50
        MaxRequestsPerChild   100
</IfModule>

Любая помощь будет принята с благодарностью!

Ответы [ 2 ]

0 голосов
/ 05 августа 2020

Решена путем добавления файла ssl.conf вместе с project.conf.bak вместе с файлом project.conf

0 голосов
/ 05 августа 2020

Ваш RewriteEngine перенаправляет порт 80 на HTTPS, который идет на порт 443, который не определен.

Если вы хотите запустить сервер под портом 80 (HTTP-соединение), удалите

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...