#Deployment
##Before deployment
##Deployment
Run Mongo DB as win service
Create "statements" and "results" collection within "lrs" DB.
use lrs
db.createCollection("statements");
db.createCollection("results");
Create indexes for most frequently used filter properties:
use lrs
db.statements.ensureIndex({ "context.extensions.http://easygenerator/expapi/course/id" : 1});
db.statements.ensureIndex({ "context.extensions.http://easygenerator/expapi/learningpath/id" : 1});
db.statements.ensureIndex({ "verb.id" : 1});
db.statements.ensureIndex({ "context.registration" : 1});
db.results.ensureIndex({ "id" : 1, "last_activity": -1 });
db.results.ensureIndex({ "attempt_id" : 1 });
Clone this Git repository locally
Run npm install in the root
Create web.config file in the root to register iisnode module as a handler for our app.js file and to configure URL rewriting module:
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="app.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="lrsApp">
<match url="/*" />
<action type="Rewrite" url="app.js" />
</rule>
</rules>
</rewrite>
<defaultDocument enabled="true">
<files>
<add value="app.js" />
</files>
</defaultDocument>
<httpErrors existingResponse="PassThrough"></httpErrors>
</system.webServer>
<appSettings>
<add key="IP" value="127.0.0.1" />
<add key="PORT" value="80" />
</appSettings>
</configuration>
Create 'iisnode.yml' file in the root to override default node run options and to specify --harmony flag
nodeProcessCommandLine: node.exe --harmony #full path can be used here as well
Copy folder to the server (without .git and package.json:))
Create Web site in IIS and add corresponding site bindings and permissions
To generate results into results collection from existing data in statements collection install "co" module via npm and run:
node migration/exec.js
If your mongodb instance is hosted under a non-default location, set the MONGO_URI environment variable.
Or, set the DBHOST and DBNAME environment variables, and the lrs will connect to mongodb://${DBHOST}/${DBNAME} instead.
For example, in the IIS config, simply add <app key="DBHOST" value="..." /> and <app key="DBNAME" value="..." /> to the <appSettings> element.
If you set the AUTH_USER and AUTH_PASSWORD environment variables, the LRS will prompt for and require basic authentication credentials for all xAPI requests.
Content type
Image
Digest
Size
85 MB
Last updated
almost 9 years ago
docker pull wonderlic/easygen-lrs