无法使用子域GoDaddy,AWS和Routes部署Laravel 5.2

时间:2019-05-22 13:53:30

标签: php laravel amazon-web-services deployment

它不在共享服务器(cPanel)上

我在做什么错?我在Laravel 5.2中有两个应用程序 在本地正常工作的区域(后端和前端),定义 虚拟主机,但是当我尝试部署到生产服务器时,它 显示空白页。该域位于GoDaddy中,具有两个子域 指向AWS(php 5.6)中的Ubuntu 18服务器。

有人知道为什么不重定向到直接路由吗?感谢您的帮助。

site.mydominio.com Redireccionado一个 http://ipserveramazon/vouchervalidation/public admin.mydominio.com Redireccionado a http://ipserveramazon/vouchervalidation/public

app \ http \ routes.php

Route::get('/', function () {
return redirect()->route('home.index');

//die('Working');
});
Route::get('/frontend', function () {
return redirect()->route('home.index');
});
Route::get('/backend', function () {
return redirect()->route('dashboard.index');
});

路由前端:

Route::group(['namespace' => 'Modules\Frontend\Http\Controllers',
'domain'     => 'site.'.getenv('HOST_NAME'), 'middleware' => ['web']],
function(){
Route::get('/', 'HomeController@index');

Route::any('/', function(){
return redirect()->route('home.index');
});

Route::group(array('prefix' => 'home'), function(){
Route::get('index', array('as' => 'home.index', 'uses' =>
'HomeController@index'));
});
...
});

路由后端:

Route::group(['namespace' => 'Modules\Backend\Http\Controllers',
'domain' => 'admin.'.getenv('HOST_NAME'), 'middleware' =>
['web','auth']], function(){

Route::get('backend', array('as' => 'backend.index', 'uses' =>
'BackendController@index'));
Route::get('dashboard', array('as' => 'dashboard.index', 'uses' =>
'DashboardController@index'));

Route::group(array('prefix' => 'dashboard'), function(){
Route::get('get-documents-chart/{year}', array('as' =>
'dashboard.get-documents-chart', 'uses' =>
'DashboardController@getDocumentsChart'));
});
…
});

*。htacess文件位于公用文件夹中:*

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>

RewriteEngine On
RewriteBase /var/www/html/vouchervalidation/public/
   # change above to your site i.e.,  RewriteBase /whatever/public/

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
*apache2.conf file in /etc/apache2 : *

ServerName localhost

Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf

<Directory />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/html/vouchervalidation/public>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
*000-default.conf in etc/apache2/sites-enabled : *

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/vouchervalidation/public
<Directory /var/www/html/vouchervalidation/public>
Allowoverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<VirtualHost site.protelcotelsa.com:80>
ServerAdmin webmaster@localhost
ServerName site.protelcotelsa.com
ServerAlias site.protelcotelsa.com
DocumentRoot /var/www/html/vouchervalidation/public
<Directory /var/www/html/vouchervalidation/public>
Allowoverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<VirtualHost admin.protelcotelsa.com:80>
ServerAdmin webmaster@localhost
ServerName admin.protelcotelsa.com
ServerAlias admin.protelcotelsa.com
DocumentRoot /var/www/html/vouchervalidation/public
<Directory /var/www/html/vouchervalidation/public>
Allowoverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

我尝试了以下操作:

sudo a2enmod重写

sudo chgrp -R www-数据存储引导程序/缓存

sudo chmod -R ug + rwx存储引导程序/缓存

我尝试将公用文件夹的内容传递到/ var / www / html /并编辑文件index.php,.htacess,导致 同样的问题。

composer install --optimize-autoloader --no-dev

php artisan config:cache

php artisan route:cache

php artisan厂商:发布

sudo a2dissite 000-default.conf

sudo a2ensite 000-default.conf

我将ubuntu服务器更改为14.04,导致与以下问题相同 空白页。

添加模具(“工作中”);路线和好

http://3.14.103.54/vouchervalidation/public/index.php/frontend(同样有问题)

http://3.14.103.54/vouchervalidation/public/index.php/backend(同样有问题)

...

但没有结果,请帮忙

0 个答案:

没有答案