elastic-beanstalk

.htaccess redirect loop when trying to add forced HTTPS rule (Amazon Elastic Beanstalk)

拈花ヽ惹草 提交于 2019-11-29 02:35:18
I started receiving this error after trying to incorporate a rule to force HTTPS in the production environment. The BWC_ENV environment variable can have a handful of different values: "prod", "stage", "ben_local", "nam_local", etc. Here's my .htaccess: RewriteEngine On # Force HTTPS RewriteCond %{HTTPS} !=on RewriteCond %{ENV:BWC_ENV} ^prod$ RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Parse the subdomain as a variable we can access in our scripts RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{HTTP_HOST} !^www RewriteCond %{HTTP_HOST} ^([^\.]+)\.([^\.]+)\.([^\.]+)$

AWS Elastic Beanstalk and Composer

十年热恋 提交于 2019-11-29 02:14:41
I have an application with Composer dependencies which I want to deploy to an Elastic Beanstalk container. However my composer.json file is not in the project root folder. My project root has the following structure: - .ebextensions - scripts - www (Webroot) - composer.json And I have set the document root to /www in the container configuration options. The issue is that I need to install composer on the box and run the composer install script to add the project dependencies. I understand that during a deploy EB will check to see if there is a composer.json file in the project root and install

Environment specific ebextensions commands

可紊 提交于 2019-11-29 02:03:36
I have a spring-boot application for which I need to specify graphite server and port (to send metrics). For that to work, I have to install and configure statsd . I do that using the ebextensions file. commands: 01_nodejs_install: command: sudo yum -y install nodejs npm --enablerepo=epel ignoreErrors: true 02_mkdir_statsd: command: mkdir /home/ec2-user/statsd ignoreErrors: true 03_fetch_statsd: command: git clone https://github.com/etsy/statsd.git /home/ec2-user/statsd ignoreErrors: true 04_change_example_config: command: "cat exampleConfig.js | sed 's/2003/<graphite-port>/g' | sed 's

Static IP using Elastic Beanstalk

℡╲_俬逩灬. 提交于 2019-11-29 01:21:34
I need the static IP to allow access to a firewalled network not on the AWS network. Is it possible to get a static IP for a load balanced app using Elastic Beanstalk? I'm following the AWS docs regarding using Route 53 to host my app with a domain name, but from what I've read, this does not ensure a static IP because it is essentially using a CNAME allowing the IP behind the scenes to change. Is that the right understanding? Is it possible at all? Amazon has published a new example especially for you: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/vpc-basic.html You can deploy an

I can't find my Web app when I SSH to my AWS Elastic Beanstalk instance

不打扰是莪最后的温柔 提交于 2019-11-28 23:53:46
I've set up SSH to my AWS Elastic Beanstalk instance using eb ssh --setup and can successfully SSH to my environment. But I can't see my Web application. When I am connected I find myself in an empty directory ( ec2-user ) and when I cd /home I just see drwx------ 3 ec2-user ec2-user 4096 Jan 15 21:37 ec2-user dr-xr-xr-x 23 root root 4096 Jan 15 21:03 .. drwxr-xr-x 3 root root 4096 Oct 22 23:29 . Where is my Web application located? Do $ sudo find / -name <insert main file name here> to find out. For example: $ sudo find / -name \*.php /var/lib/tomcat8/webapps/ROOT/info.php /var/lib/tomcat8

How to set an environment variable in Amazon Elastic Beanstalk (Python)

风格不统一 提交于 2019-11-28 23:39:12
I have been working on a Django application lately, trying to get it to work with Amazon Elastic Beanstalk. In my .ebextensions/python.config file, I have set the following: option_settings: - namespace: aws:elasticbeanstalk:application:environment option_name: ProductionBucket value: s3-bucket-name - namespace: aws:elasticbeanstalk:application:environment option_name: ProductionCache value: memcached-server.site.com:11211 However, whenever I look on the server, no such environment variables are set (and as such, aren't accessible when I try os.getenv('ProductionBucket') I came across this

Elastic Beanstalk Change ELB Type

隐身守侯 提交于 2019-11-28 23:37:30
Does anyone know if it's possible to change an existing AWS Elastic Beanstalk environment to an Application Load Balancer (instead of a classic one). As far as I know only Application ELB's can be protected with AWS WAF and DDOS "Shield" so any existing EB app can't take advantage of these features since they have classic ELB's. Hello As Per AWS Documentation: The Elastic Beanstalk Environment Management Console only supports creating and managing an Elastic Beanstalk environment with a Classic Load Balancer. For other options, see Application Load Balancer and Network Load Balancer. Also Note

How to Install and configure Redis on ElasticBeanstalk

末鹿安然 提交于 2019-11-28 23:36:11
How do I install and configure Redis on AWS ElasticBeanstalk? Does anyone know how to write an .ebextension script to accomplish that? AWS Elastic Beanstalk does provide resource configuration via the .ebextensions folder. Essentially you need to tell Elastic Beanstalk what you would like provisioned in addition to your application. For provisioning into a default vpc. You need to create an .ebextensions folder add an elasticache.config file and include the following contents. Resources: MyCacheSecurityGroup: Type: "AWS::EC2::SecurityGroup" Properties: GroupDescription: "Lock cache down to

Celery: WorkerLostError: Worker exited prematurely: signal 9 (SIGKILL)

那年仲夏 提交于 2019-11-28 22:31:45
I use Celery with RabbitMQ in my Django app (on Elastic Beanstalk) to manage background tasks and I daemonized it using Supervisor. The problem now, is that one of the period task that I defined is failing (after a week in which it worked properly), the error I've got is: [01/Apr/2014 23:04:03] [ERROR] [celery.worker.job:272] Task clean-dead-sessions[1bfb5a0a-7914-4623-8b5b-35fc68443d2e] raised unexpected: WorkerLostError('Worker exited prematurely: signal 9 (SIGKILL).',) Traceback (most recent call last): File "/opt/python/run/venv/lib/python2.7/site-packages/billiard/pool.py", line 1168, in

Your WSGIPath refers to a file that does not exist

不羁的心 提交于 2019-11-28 22:29:32
I'm trying to upload my Flask application to AWS however I receive an error on doing so: Your WSGIPath refers to a file that does not exist. After doing some digging online I found that in the .ebextensions folder, I should specify the path. There was not a .ebextensions folder so I created one and added the following code to a file named settings.config: option_settings: "aws:elasticbeanstalk:container:python": WSGIPath: project/application.py the WSGIPath is the correct path to the application.py file so I'm not sure what raises this error. Am I changing the WSGIPath right, is there a better