laravel - Elastic Beanstalk, configuration never ran? -
i working on deploying app throught elastic beanstalk.
however, have noticed config files never ran, know by:
i have set document root, when go settings throught aws empty, have set environment variables empty, when set manually throught website working fine, in event log (while deploying) apparently should see output saying config has ran successfully. tried every log , wasn't mentioned anywhere.
i running laravel 5.4 , .ebextensions folder created in root of project. inside have 01-environment.config:
option_settings: aws:elasticbeanstalk:container:php:phpini: document_root: /public memory_limit: 512m aws:elasticbeanstalk:sqsd: httppath: /worker/queue aws:elasticbeanstalk:application:environment: app_env: production app_key: base64:mdkarordueoztysvq50zdjet7es7msvote3r001+xbs= app_debug: true 02-deploy.config
container_commands: 01-migrations: command: "php artisan migrate --force" command: "php artisan key:generate" command: "php artisan config:clear" command: "php artisan config:cache" 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 chmod -r 777 /var/app/current/bootstrap/cache if [ ! -f /var/app/current/storage/logs/laravel.log ]; echo "creating /storage/logs/laravel.log..." owner: root group: root content: | #!/usr/bin/env bash echo "making /storage writeable..." chmod -r 777 /var/app/current/storage chmod -r 777 /var/app/current/bootstrap/cache if [ ! -f /var/app/current/storage/logs/laravel.log ]; 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 ]; echo "creating /public/storage symlink..." ln -s /var/app/current/storage/app/public /var/app/current/public/sto$ fi "/opt/elasticbeanstalk/tasks/publishlogs.d/laravel-logs.conf": chown webapp:webapp /var/app/current/storage/logs/laravel.log fi if [ ! -d /var/app/current/public/storage ]; echo "creating /public/storage symlink..." ln -s /var/app/current/storage/app/public /var/app/current/public/sto$ 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: | /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] as see have redirect here also, doesn't work go on http default, don't laravel log on s3 either or other command. knows why?
/var/log/eb-activity.log should show .config files being executed.
in 02-deploy.config, there several issues.
under
container_commands, can have 1 command percommand:. try this:container_commands: 01-migrations: command: "php artisan migrate --force" 02-generate-key: command: "php artisan key:generate" 03-config-clear: command: "php artisan config:clear" 04-config-cache: command: "php artisan config:cache"you have inconsistent whitespace. yaml files sensitive whitespace, make sure you're using same amount of indent (usually 2 spaces) per level.
might copy/paste problem,
99_make_storage_writable.shsection has duplicated lines.
Comments
Post a Comment