EC2 实例上托管的 Laravel 项目的站点部署连接被拒绝

我正在尝试在运行 CentOS7 的 AWS EC2 实例上使用 Laravel 部署我的网站。我已经检查以确保端口和流量设置正确,并且它们是因为我能够在编辑conf之前访问apache登陆页面,并且我还能够ssh并ping IP,但我相信我是配置文件可能存在一些问题。这就是我到达终点时所遇到的情况:

https://img.mukewang.com/650424900001a48f04320140.jpg

https://img1.mukewang.com/6504249500012c2a03580117.jpg

我的 httpd 正在运行,并且我能够在编辑配置文件之前访问 apache 登录页面。


这是我的 httpd.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/[project_path]/public"

#

# Relax access to content within /var/www.

#

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

#

# DirectoryIndex: sets the file that Apache will serve if a directory

# is requested.

#

<IfModule dir_module>

    DirectoryIndex index.html

</IfModule>

#

# The following lines prevent .htaccess and .htpasswd files from being

# viewed by Web clients.

#

<Files ".ht*">

    Require all denied

</Files>


桃花长相依
浏览 101回答 2
2回答

一只甜甜圈

通过添加一个ssl.conf文件以及与该文件project.conf.bak一起的解决了这个问题project.conf

陪伴而非守候

您的 RewriteEngine 正在将端口 80 重定向到 HTTPS,该 HTTPS 会转到未定义的端口 443。如果要在端口 80(HTTP 连接)下运行服务器,请删除<IfModule mod_rewrite.c>RewriteEngine onRewriteCond %{HTTPS} offRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]</IfModule>
打开App,查看更多内容
随时随地看视频慕课网APP