lucasmbraz
4/8/2015 - 9:54 AM

mlea deployment.md

MLEA Deployment

Make sure you have Nginx, MySQL and PHP installed

https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-14-04

Install Rails

https://gist.github.com/lmonteirobraz/fe96e640be485c2e01c7

Get the server code

$ git clone git@bitbucket.org:lmonteirobraz/server_mlea.git

Modify this section of the file config/database.yml to match your own database

production:
  adapter: mysql2
  database: moodle
  host: localhost
  username: root
  password: wl2bwT@rn

Install Passenger

https://gorails.com/deploy/ubuntu/14.04

Modify the file /etc/nginx/sites-enabled/default to the following

This will make mlea run on port 8080 (you can change that if you want)

server {
     listen 8080 default_server;
     listen [::]:8080 default_server ipv6only=on;

    passenger_enabled on;
    rails_env production;
    root YOUR_PATH/server_mlea/public;

    server_name YOUR_SERVER_IP;

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}

Enable Push Notifications

$ whenever -w

Install Android Studio

http://developer.android.com/sdk/index.html

Get the client code

git clone git@bitbucket.org:tserro/mlea.git

Point the client code to your server

Modify this section of the file MLEA/build.gradle to match your server url

release {
            debuggable true
            buildConfigField "String", "SERVER_URL", "YOUR_SERVER_URL"
            signingConfig android.signingConfigs.debug
        }

Build the release version

On Android Studio make sure you have the build variant Release