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:

  1. Login to AWS Console
  2. Start the server instance
  3. Open the “Connect” tab on the top-left corner
  4. Select the SSH client section
  5. Open terminal, switch to the directory where the private key pem is stored
  6. Run the commands provided in the SSH client section to connect to the server instance
    1. Typical command: ssh -i "your-key.pem" ec2-user@your-ec2-public-ip
  7. Update packages: sudo yum update -y
    1. Note: this command is for Amazon Linux instance
  8. Install python (if needed): sudo yum install python3-pip -y
    1. Note: this command is for Amazon Linux instance
  9. Install Git (if needed): sudo yum install git -y
    1. Note: this command is for Amazon Linux instance
  10. Clone repository using git: *git clone https://github.com/SpecialNoel/Giraffael2.git*
  11. Switch to the working directory: cd Giraffael2
  12. Install dependencies: pip install --no-cache-dir -r backend/requirements.txt
    1. Check python3 version: python3 —version
      1. Current version: Python 3.9.20
      2. Note: run python —version will give error, since we only use python3
    2. Check the lastest python3 version in AWS EC2: sudo yum list | grep python3
    3. To use pyenv, checkout this instruction
  13. Run the server: python3 src/chat_app.py
    1. Note: This has not been reviewed and updated since the latest change. Will comeback later to update.

Make sure the app is accessible:

  1. Ensure the port the application listens on is open in the security group in AWS console
  2. In terminal, run the typical command: telnet your-ec2-public-ip 5000