User Tools

Site Tools


medal-data:system-setup

This is an old revision of the document!


Setup of medAL-data System

Purpose and scope

In this document, you will learn how to perform the basic setup of the MainData System.

Requirements

  • Server Linux =8gb ram
  • Storage= 300 gb
  • Operating System = ubuntu 18.04

Install Docker

  1. To update ubuntu server, type:
    sudo apt update
  2. Install a few prerequisite packages which let apt use packages over HTTPS by typing:
    sudo apt install apt-transport-https ca-certificates curl software-properties-common
  3. Add the GPG key for the official Docker repository to your system by typing:
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  4. Add the Docker repository to APT sources:
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
  5. Update the package database with the Docker packages from the newly added repository:
    sudo apt update
  6. Make sure you are about to install from the Docker repository instead of the default Ubuntu repository:
    apt-cache policy docker-ce
  7. Finally, install Docker:
    sudo apt install docker-ce
  8. Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:
    sudo systemctl status docker

For more information, you can check on this site (https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04)

Install Nginx

  1. Check if nginx is installed on the server by typing in the terminal “systemctl status nginx”
  2. If it is not installed open terminal
  3. Install nginx “sudo apt install nginx”
  4. Enable nginx in the firewall by typing “sudo ufw allow 'Nginx Full'
  • Dokku
  1. Check if Dokku is installed on the server by typing in the terminal “dokku -v”
  2. If it is not installed open terminal

sudo DOKKU_TAG=v0.21.4 bash bootstrap.sh”

  1. Once the installation is complete, you can open a browser to setup your SSH key and virtualhost settings.
  2. Open your browser of choice and navigate to the host's IP address - or the domain you assigned to that IP previously - and configure Dokku via the web admin.
  • Installation of MainData.

- Requirements • You must have the MainData Project folder • Git must be installed on your laptop

- Installation steps 1. Open command prompt (for windows) or terminal (for Linux and Mac) 2. Navigate to the MainData project folder (Parent Diretory). (Let’s call this user terminal) 3. Open another terminal/ Command Prompt and log into the server as root (let’s call it Server terminal) 4. On the Server terminal, create an app by “ ” 5. Specify the web server type that will be running “echo 'web: vendor/bin/heroku-php-apache2 public/' » Procfile” 6. On you user terminal,initialize git “git init” 7. Add the project to git “git add. /” 8. Connect local git with the domain “git remote add dokku dokku@your_domain: Main-Data”.Your_domain means the domain of the server 9. Commit to git “git commit -m “Initial commit”” 10. For the registration of the app on dokku Server, copy the value of APP_KEY variable in the .env file located in the root directory of your Laravel Project. Then, login to your VPS and register the APP_KEY environmental variable for your app “dokku config:set blog APP_KEY=key”.Replace key with the actual APP_KEY 11. Push the application on dokku with “git push dokku master” 12. Install the postgres plugin “sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres” 13. Create database “dokku mysql:create main-data-Db” 14. Link database service to our application “dokku mysql:link main-data-Db Main-Data” 15. Type “dokku mysql:info blogdb –dsn” and obtain the value from that and type in “dokku config:set blog DATABASE_URL=value” with value as the value above 16. go back to your application on local, and modify the config/database.php file in such a way that the postgres section looks like below

17. on the user terminal “git add ./” 18. commit “git commit -m “Modified config/database.php file”” 19. push the commit “git push dokku master” 20. finally migrate the database “dokku run Main-Data php artisan migrate” 6. Domain set up 1. On Your Server Terminal 2. Set domain “sudo domains:set Main-Data domain” where domain is the domain for MainData - Setting up letsencrypt with Dokku 1. On your Server Terminal.Install letsencrypt plugin with “sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git” 2. Install certificate with “sudo dokku letsencrypt Main-Data” 3. Open your browser and test the system - Creating an Admin 1. On your server terminal “sudo dokku run Main-Data php artisan tinker” 2. Type “$user=new User;” for a new user object 3. Type “$user→name=”user_name”;” for the ADMIN name 4. Type “$user→email=”user_email”;” for the ADMIN email 5. Type “$user→password=Hash::make(“user_password”);” for the ADMIN password 6. Type “$user→syncRoles(“ADMIN”);” To make this user an admin 7. Try to access the web and log in with this user in the system

Administrative information

Name	Signature	Date

Author Ibrahim Evans 12.11.2020 Revised by Approved by

Document change control: Version Changes Name Date 01 New Document Ibrahim Evans 12.11.2020

Distribution of SOP: Name Role Health facility / Institute Date

*Note: When printing and distributing the SOP, the administrative information page does not need to be included.

medal-data/system-setup.1642426802.txt.gz · Last modified: 2022/01/17 14:40 by arnaudpoletto