A list of steps to setup and run the server remotely with AWS.
(Note: These steps are not complete, as I didn’t try following them once more time to see if they are reproducible.)
Steps:
- Login to AWS Console
- Start the server instance
- Open the “Connect” tab on the top-left corner
- Select the SSH client section
- Open terminal, switch to the directory where the private key pem is stored
- Run the commands provided in the SSH client section to connect to the server instance
- Typical command: ssh -i "your-key.pem" ec2-user@your-ec2-public-ip
- Update packages: sudo yum update -y
- Note: this command is for Amazon Linux instance
- Install python (if needed): sudo yum install python3-pip -y
- Note: this command is for Amazon Linux instance
- Install Git (if needed): sudo yum install git -y
- Note: this command is for Amazon Linux instance
- Clone repository using git: *git clone https://github.com/SpecialNoel/Giraffael2.git*
- Switch to the working directory: cd Giraffael2
- Install dependencies: pip install --no-cache-dir -r backend/requirements.txt
- Check python3 version: python3 —version
- Current version: Python 3.9.20
- Note: run python —version will give error, since we only use python3
- Check the lastest python3 version in AWS EC2: sudo yum list | grep python3
- To use pyenv, checkout this instruction
Run the server: python3 src/chat_app.py
- Note: This has not been reviewed and updated since the latest change. Will comeback later to update.
Make sure the app is accessible:
- Ensure the port the application listens on is open in the security group in AWS console
- In terminal, run the typical command: telnet your-ec2-public-ip 5000