Giter Club home page Giter Club logo

elastic-beanstalk-nginx-uwsgi-django's Introduction

elastic-beanstalk-nginx-uwsgi-django

A Django sample app running with uWSGI and Nginx on AWS Elastic Beanstalk.

$ eb init
$ eb create ebsample-env -p "Python 2.7" --single --sample

Setup environment properties:

$ eb setenv ALLOWED_HOSTS=<domain name> \
  DATABASE_URL=mysql://<user:pass>@<host>:3306/<dbname>?charset=utf8mb4 \
  DEBUG=off \
  DJANGO_SETTINGS_MODULE=ebsample.settings \
  SECRET_KEY=<secret key> \
  WSGI_MODULE=ebsample.wsgi 

Software Configuration

$ eb deploy
or 
$ eb deploy --staged

$ eb open

Change History:

  • (11/24/2018): Upgraded platform to Python 2.7 running on 64bit Amazon Linux/2.7.6.
  • (06/26/2018): Upgraded platform to Python 2.7 running on 64bit Amazon Linux/2.7.1.
  • (01/16/2018): Upgraded platform to 64bit Amazon Linux 2017.09 v2.6.3 running Python 2.7.
  • (01/16/2018): Use pipenv to manage requirements.
  • (09/16/2017): Works with latest platform '64bit Amazon Linux 2017.03 v2.5.1 running Python 2.7'.
  • (06/05/2017): Works with latest platform '64bit Amazon Linux 2017.03 v2.4.0 running Python 2.7'.
  • (04/07/2017): Create a super user 'admin' for Admin Site, the initial password is first 8 characters of your SECRET_KEY.
  • (04/07/2017): Upgraded platform to 64bit Amazon Linux 2016.09 v2.3.3 running Python 2.7.
  • (01/29/2017): Configure uWSGI module parameter via environment variable.
  • (01/29/2017): Upgraded platform to 64bit Amazon Linux 2016.09 v2.3.1 running Python 2.7.
  • (12/26/2016): Now running on "64bit Amazon Linux 2016.09 v2.3.0 running Python 2.7".
  • (12/12/2016): Works with "64bit Amazon Linux 2016.09 v2.2.0 running Python 2.7".
  • (07/02/2016): Works with "64bit Amazon Linux 2016.03 v2.1.3 running Python 2.7".
  • (05/29/2016): Use django-environ to read configurations from EB env file.
  • (05/29/2016): Works with "64bit Amazon Linux 2016.03 v2.1.0 running Python 2.7".
  • (02/21/2016): Works with "64bit Amazon Linux 2015.09 v2.0.7 running Python 2.7".
  • (07/09/2015): Now it's compatible with "64bit Amazon Linux 2015.03 v1.4.3 running Python 2.7".

elastic-beanstalk-nginx-uwsgi-django's People

Contributors

babusqb avatar wolfg1969 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elastic-beanstalk-nginx-uwsgi-django's Issues

doc request

hey can you add doc on what AMI to use for this? I know there are issues with the new Amazon Linux AMIs and geodjango support. The 2013.09 instances worked fine.

Address already in use Error - 64bit Amazon Linux 2015.09 v2.0.6 running Python 2.7


/var/log/eb-activity.log

[2016-02-10T04:10:12.147Z] INFO [15777] - [Application update/AppDeployStage1] : Starting activity...
[2016-02-10T04:10:12.147Z] INFO [15777] - [Application update/AppDeployStage1/AppDeployEnactHook] : Starting activity...
[2016-02-10T04:10:12.147Z] INFO [15777] - [Application update/AppDeployStage1/AppDeployEnactHook/01flip.py] : Starting activity...
[2016-02-10T04:15:23.011Z] INFO [15777] - [Application update/AppDeployStage1/AppDeployEnactHook/01flip.py] : Completed activity. Result:
httpd: stopped
httpd: started
httpd RUNNING pid 882, uptime 0:00:03
2016-02-10 04:15:23,006 WARNING Apache is running, but root page is not responding in 5mins.
[2016-02-10T04:15:23.011Z] INFO [15777] - [Application update/AppDeployStage1/AppDeployEnactHook/02create_pids_for_monitoring.sh] : Starting activity
...
[2016-02-10T04:15:23.115Z] INFO [15777] - [Application update/AppDeployStage1/AppDeployEnactHook/02create_pids_for_monitoring.sh] : Completed activit
y. Result:

  • chmod 0755 /var/run/httpd

  • /opt/elasticbeanstalk/bin/healthd-track-pidfile --proxy httpd

  • /opt/elasticbeanstalk/bin/healthd-track-pidfile --name application --location /opt/python/run/supervisord.pid
    [2016-02-10T04:15:23.115Z] INFO [15777] - [Application update/AppDeployStage1/AppDeployEnactHook/99loadnewservice.sh] : Starting activity...
    [2016-02-10T04:15:26.060Z] INFO [15777] - [Application update/AppDeployStage1/AppDeployEnactHook/99loadnewservice.sh] : Completed activity. Result:

    celery-myapp: disappeared

    uwsgi: available

    Restarted supervisord

    Stopping nginx: [ OK ]

Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

[ OK ]


Any idea on why this happens? I assumed that httpd will be set to serve through different port or killed. If I find anything meanwhile, I'll fix and raise the PR.

Your WSGIPath refers to a file that does not exist.

eb config

  aws:elasticbeanstalk:container:python:
    NumProcesses: '3'
    NumThreads: '20'
    StaticFiles: /static/=static/
    WSGIPath: ebsample/wsgi.py

configuration of eb env
https://i.imgur.com/Ecal3Sx.png
But I always get "Your WSGIPath refers to a file that does not exist." error message when I do eb setenv , any suggestions ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.