Skip to content

Instantly share code, notes, and snippets.

@quietcricket
Last active September 25, 2019 04:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quietcricket/497c9a7f79d270d47719c84de236cb07 to your computer and use it in GitHub Desktop.
Save quietcricket/497c9a7f79d270d47719c84de236cb07 to your computer and use it in GitHub Desktop.
EC2 AMI Linux 2 Installation, with python, uwsgi, supervisor, certbot & nginx
sudo yum update
# call amazon-linux-extras to view what packages are available
sudo amazon-linux-extras install nginx1
sudo systemctl enable nginx.service
sudo systemctl start nginx.service
# gcc and python-devel required for uwsgi
sudo yum groupinstall 'Development Tools'
sudo yum install python3-devel.x86_64
# uwsgi needs root permission
sudo pip3 install uwsgi
sudo pip3 install supervisor
pip3 install flask
sudo touch /usr/local/etc/supervisord.conf
sudo chown ec2-user /usr/local/etc/supervisord.conf
/usr/local/bin/echo_supervisord_conf > /usr/local/etc/supervisord.conf
# certbot installation
# certbot seems only work with python2, not sure how this is going to change in the future
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-an-instance.html#letsencrypt
sudo yum install python2-certbot-nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment