Я пытался развернуть свой проект Laravel на сервере Elasticbeanstalk, я получаю эту ошибку:
Ошибка интерфейса:
У вас нет прав доступа / на этом сервере.
Ошибка в файле журнала:
Невозможно обслуживать каталог / var / www / html / public /: нет совпадений
DirectoryIndex (index.html, index.php) найден и сгенерирован сервером
индекс каталога запрещен директивой опций
У меня есть файлы .htaccess и index.php в корне, а не в общей папке.
.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
.ebextensions / 01-main.config
container_commands:
01-optimize:
command: "/usr/bin/composer.phar dump-autoload --optimize"
02-migrations:
command: "php artisan migrate --env=production"
03-cache:
command: "php artisan cache:clear"
cwd: "/var/app/ondeck"
04-optimize:
command: "php artisan optimize --force"
cwd: "/var/app/ondeck"
05-permissions:
command: "chmod 777 -R /var/app/ondeck"
cwd: "/var/app/ondeck"
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/99_make_storage_writable.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
echo "Making /storage writeable..."
chmod -R 777 /var/app/current/storage
if [ ! -f /var/app/current/storage/logs/laravel.log ]; then
echo "Creating /storage/logs/laravel.log..."
touch /var/app/current/storage/logs/laravel.log
chown webapp:webapp /var/app/current/storage/logs/laravel.log
fi
if [ ! -d /var/app/current/public/storage ]; then
echo "Creating /public/storage symlink..."
ln -s /var/app/current/storage/app/public /var/app/current/public/storage
fi
"/opt/elasticbeanstalk/tasks/publishlogs.d/laravel-logs.conf":
mode: "000755"
owner: root
group: root
content: |
/var/app/current/storage/logs/*.log
"/etc/httpd/conf.d/https_redirect.conf":
mode: "000644"
owner: root
group: root
content: |
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} ^http$
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=307,L]
.ebextensions / 02-project.config
commands:
01_update_composer:
command: export HOME=/root && export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: COMPOSER_HOME
value: /root
- namespace: aws:elasticbeanstalk:application:environment
option_name: HOME
value: /root
- namespace: aws:elasticbeanstalk:container:php:phpini
option_name: document_root
value: /public
- namespace: aws:elasticbeanstalk:container:php:phpini
option_name: memory_limit
value: 512M
- namespace: aws:elasticbeanstalk:sqsd
option_name: HttpPath
value: /worker/queue
- namespace: aws:elasticbeanstalk:container:php:phpini
option_name: zlib.output_compression
value: Off
- namespace: aws:elasticbeanstalk:container:php:phpini
option_name: allow_url_fopen
value: On
- namespace: aws:elasticbeanstalk:container:php:phpini
option_name: max_execution_time
value: 4000
Любая помощь будет оценена.
Спасибо