MathML Cloud Server Admin

compared with
Current by Nirupa Kumar
on Mar 22, 2016 18:08.

This line was removed.
This word was removed. This word was added.
This line was added.

Changes (12)

View Page History

h1. URLs

* Live: []
* Staging: []
* Live API: []
* Staging API: []
** _The API URLs are the same as the app because we are bypassing the Azure API Management gateway for now since it has some unresolved issues._


To provision a server on Azure:

h1. Database changes

Sails will not do any database migrations when running as production. Sails.js, [], recommends using 1 of 2 approaches for database migrations:


Up to this point, all production database migrations for have been performed by cloning the release branch, updating config/connections.js with the url to production's MongoLab database, and running sails lift in your local checkout's home directory, ex \~/boss/mathmlcloud-v5.1.5

h1. Deploy code to staging

Each of the repositories has a hook defined similarly:
* mmlc-app: []
* mmlc-api: []

The hook is implemented within the API in the api/controllers/GitHookController.js file.

* ssh to the server
* checkout the latest releases for the app and for the api. The api is installed at \~/mathml-cloud and the app is installed at \~/mathml-cloud/assets.
* install any new node packages
* restart the server

Starting the app as production will not perform any database migrations so they will have to be done locally (See Database changes above).

h1. Troubleshooting

Steps to follow if website is down :
* Try restarting from Azure
* Run command to check if process is running by:

ssh -l mmlc -p 22
cd mathml-cloud
sudo pm2 list
Should see one process running. If not , need to restart server by running the following command :
sudo pm2 stop 0 # stop process 0, MMLC (precautionary)
pm2 start app.js # starts MMLC