Last active
September 25, 2019 04:31
-
-
Save quietcricket/497c9a7f79d270d47719c84de236cb07 to your computer and use it in GitHub Desktop.
EC2 AMI Linux 2 Installation, with python, uwsgi, supervisor, certbot & nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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