Skip to content

[Old] Single Server AMI Help

Eli Jones edited this page Sep 5, 2023 · 1 revision

This is a helper page for the deprecated Single-Server AMI deployment process, its content was taken from the Beiwe deployment extra information for non IT users page.

This page will not be updated.

Quick setup (single-server AMI)

This setup is only recommended for small studies, such as those with less than 20 participants. For larger studies, robust setup is strongly recommended.

Launch your server from the public Beiwe AMI

  1. Log in to your Amazon Web Services account, or create one by going to https://aws.amazon.com and clicking "Create an AWS account".

  2. Click this link to launch the most recent Beiwe AMI: Beiwe_v0.2 (ami-d97ddea6).

The following screenshots take you through the key parts of AWS launching process:

  1. Step 2:

  2. Step 3:

  3. Click through to Step 6.

  4. Step 6:

  5. Click on "Review and launch" on the bottom right, then click on "Launch" to launch the instance. You will be asked to select an existing key pair or create a new key pair for the instance. This key pair is used to securely access your instance in the future. If you are setting up AWS instance for the first time, go ahead and choose "Create a new key pair" in the drop-down menu, and give the key pair a name, such as "beiwekey". Then download the key pair (make sure to keep it in a safe place, such as in ~/.ssh directory).

  1. At this point, you should be able to see and log in to the web interface on your new Beiwe server.
    Finding IPv4 Public IP:

Enter this public IP in the browser address bar, it will take you to the web interface for Beiwe. Now, you can log in to Beiwe with the username admin and password admin.

Configure security and data storage on your server

  1. SSH into your instance.
    Finding IPv4 address:

Filepath of your SSH key should be something like ~/.ssh/beiwekey.pem depending on where you saved the key pair in Step 2.

  1. Replace Flask's secret key with a random string.
    After you ssh into your instance, you should be on your AWS server. From here, you can run the next lines in the directions:

    $ sed -i -r 's/replace_with_random_string/'$(cat /dev/random | tr -dc \"a-zA-Z0-9\" | fold -w 32 | head -n 1)'/g' ~/beiwe-backend/config/remote_db_env.py
    
    $ touch $HOME/beiwe-backend/wsgi.py
    
  2. Point your domain name to this server.
    Apache is a very commonly used open-source web server software. This first line of code allows entry into Apache configuration file:
    $ sudo nano /etc/apache2/sites-enabled/000-default.conf

  3. Add an SSL Certificate.
    SSL certificates provide secure and encrypted communications between your server and the internet browser. This is particularly important when participants need to enter sensitive and private information over the internet.
    SSL certificates can be added using Certbot. Follow the instructions on this link to obtain a certificate and edit your Apache configuration to enhance security with Certbot.

  4. Reset the password
    Following the directions, make your admin account more secure with a custom password.

  5. Attach an S3 bucket:

    i. For more directions on how to create an S3 bucket, click on this link: AWS guide for creating S3 bucket

    ii. Go to AWS Users page to add users.

    Then click 'Next: Permissions'.
    Click on 'Create Group', give a name to your group, then click on 'Create policy'.

    Click on 'JSON' tab, then add the code as indicated in the main deployment guide.

    After creating the user, save 'Access key ID' and 'Secret access key' for Step iii.

Follow Step 7 and Step 8 to complete your Beiwe setup and start enrolling participants!

Clone this wiki locally