-
Notifications
You must be signed in to change notification settings - Fork 4
Setting up a REDCap instance on Azure
This guide is written and tested for the following versions of REDCap and LAMP, and is intended for the purpose of testing LEAP's capabilities with REDCap.
REDCap Version: 9.5.33
LAMP by Bitnami: LAMP 7.4.9-2-r02 (Debian 10)
Download REDCap: https://community.projectredcap.org/page/download.html
Version: 9.5.33
REDCap is a PHP application that is built on the LAMP stack and depends on MySQL and an Apache web server. The easiest way to setup the LAMP stack on Azure is to use an existing template that automatically sets up all components for us. I chose LAMP by Bitnami because it is the most popular and recommended LAMP templates for Azure.
The only things that need configuration are the project details and the auto-shutdown settings, the rest are set to default. I am configuring it to use an SSH key which will be generated when I create the instance.
At this point, Azure will deploy all the resources in the new resource group.
Go to your resource group, then to your VM:
Click on the IP address:
Change the IP configuration to be Static, so that we can use it in LEAP. Hit the save button, and it will reboot the VM automatically.
The goal here is to implement extra safety so that only my computer can access the REDCap instance. I do so by configuring the Network Security Group to restrict source IP addresses to only my computer's address.
Go back to your resource group, and click on the NSG instance.
Click on HTTP, change source to IP Addresses, and enter your source IP. I am restricting access to only my LEAP instance running locally on my computer, therefore I am adding my own IP address (https://www.whatismyip.com to get your public IP)
Repeat this step for HTTPS and SSH to restrict access in a similar manner.
At this point, visit the IP address of the VM and ensure that it loads correctly.
https://docs.bitnami.com/azure/infrastructure/lamp/get-started/access-phpmyadmin/
Go to your VM instance -> Boot Diagnostics (left sidebar under Support + troubleshooting)
View the Serial log, and scroll down until you find the PHP password:
Finally, we can use an SSH tunnel to use phpMyAdmin
In the terminal:
chmod 400 REDCap-1_key.pem
ssh -N -L 8888:127.0.0.1:80 -i REDCap-1_key.pem adityachinchure@<IP-address>
You can now access phpMyAdmin on http://localhost:8888/phpmyadmin/
Login as root
, with the password you got from the serial log
CREATE DATABASE IF NOT EXISTS `redcap`;
Create a database.
- unzip the downloaded redcap files
- in
database.php
, update the db username toroot
and password to the root user password from the boot diagnostics log, and also add a string to the salt variable. Note that using theroot
user here is not safe for production environments, but for the sake of simplicity this will do. - clone the leap_connector module into the
modules
folder. Rename the LEAP Connector folder toleap_connector_v0
.
I am storing the files in the htdocs
folder, with the path /redcap
. This is so that I can access the redcap instance at the URL: <ip-address>/redcap
scp -i REDCap-1_key.pem -r <PATH TO `redcap` FOLDER> adityachinchure@<IP-address>:/opt/bitnami/apache2/htdocs/redcap
REDCap needs write access to change files on the server, such as for downloading and using external modules or importing data
ssh -i REDCap-1_key.pem adityachinchure@<IP-address>
Once logged in, run this:
cd /opt/bitnami/apache2/htdocs/ && chmod -R 777 redcap
Follow the instructions by visiting http://<IP-address>/redcap/install.php
Note: this may not work on older versions of REDCap because an email server is not set up.
Go to Control Center -> Add Users
IMPORTANT: Save the link to reset the password in a safe place. Do not visit it yet.
Go to Control Center -> Administrators & Acct Managers and add yourself as an admin.
Go to Control Center -> Security & Authentication, choose Table based authentication and hit save.
Now if you refresh the page, you will be taken to a login page.
Go to Control Center -> Administrators & Acct Managers and remove site_admin
You can now enable the LEAP external module and use it! For more info on that, visit the guide here: https://github.com/leap-project/leap/wiki/Setup-a-REDCap-Connection
- Home
- Setup LEAP for development
- Configure LEAP
- API Usage
- Connecting to REDCap