After creating an EC2 instance of OS type Amazon Linux, ssh into it using the generated security key and follow these instructions to setup the server.
ssh -i [keypair].pem ubuntu@[Elastic IP Address]
sudo apt-get update -y
sudo apt-get install nginx -y
sudo apt install python3-pip -y
sudo python3 -m pip install --upgrade pip
git clone https://github.com/KaviMD/ppe-exchange.git
cd ppe-exchange
sudo apt-get install python3-venv -y
sudo apt install virtualenv -y
Setup nginx [guide] (https://chrisdtran.com/2017/deploy-flask-on-ec2/)
sudo rm /etc/nginx/sites-enabled/default
sudo ln -s ~/ppe-exchange/example.com /etc/nginx/sites-enabled/example.com
sudo ln -s ~/ppe-exchange/500.html /var/www/html/502.html
sudo service nginx restart
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
tmux new -s ppe-exchange
flask run -h localhost -p 5000
CTRL-b
and then d
tmux a -t ppe-exchange
[Elastic IP Address]
If you cannot access it, make sure that:
- The hostname is correct
- That you have an inbound rule allowing access to port 5000