Загрузка страницы

EC2 deploy DJango application | NGINX | Supervisor | Gunicorn

I am making a series of videos available to you to learn Amazon Web services and in this session we are going to talk about deploying Django application on AWS EC2 instance.

Note: Here my django application name is "welcome"

Required packages:
sudo apt-get update
sudo apt-get install python3-pip -y
sudo pip3 install gunicorn -y
sudo apt-get install supervisor
sudo apt-get install nginx -y
sudo pip3 install django

Supervisor configuration:
sudo vi /etc/supervisor/config.d/gunicorn.conf

[program:gunicorn]
directory=/home/ubuntu/welcome
command=/usr/local/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/welco
me/app.sock welcome.wsgi:application
autostart=true
autorestart=true
stderr_logfile=gunicorn.err.log
stdout_logfile=gunicorn.out.log
[group:guni]
programs:gunicorn

Verify Supervisor configuration:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl status

NGINX configuration changes:
sudo vi /etc/nginx/sites-available/django.conf

server{
listen 80;
server_name ec2-54-221-184-166.compute-1.amazonaws.com;
location / {
include proxy_params;
proxy_pass http://unix:/home/ubuntu/welcome/app.sock;
}
}

Verify NGINX config changes and restart server:
sudo nginx -t
sudo ln django.conf /etc/nginx/sites-enabled
sudo service nginx restart
AWS Complete tutorial - https://www.youtube.com/watch?v=cakXKlc_OTk&list=PLBCBYFXVIMinELzm1GtLkWg_cPw1g8Hby

Видео EC2 deploy DJango application | NGINX | Supervisor | Gunicorn канала Technology Hub
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
18 июня 2020 г. 14:59:22
00:22:18
Яндекс.Метрика