我正在嘗試在運行 CentOS7 的 AWS EC2 實例上使用 Laravel 部署我的網站。我已經檢查以確保端口和流量設置正確,并且它們是因為我能夠在編輯conf之前訪問apache登陸頁面,并且我還能夠ssh并ping IP,但我相信我是配置文件可能存在一些問題。這就是我到達終點時所遇到的情況:我的 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>
2 回答

陪伴而非守候
TA貢獻1757條經驗 獲得超8個贊
您的 RewriteEngine 正在將端口 80 重定向到 HTTPS,該 HTTPS 會轉到未定義的端口 443。
如果要在端口 80(HTTP 連接)下運行服務器,請刪除
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
- 2 回答
- 0 關注
- 127 瀏覽
添加回答
舉報
0/150
提交
取消