Sign inSign up

wonderlic/easygen-lrs

By wonderlic

•Updated almost 9 years ago

easygen-lrs

Image
0

1.7K

wonderlic/easygen-lrs repository overview

#Deployment

##Before deployment

  1. Install nodejs v5.xx.xx⁠
  2. Install iisnode for IIS 7.x/8.x: x86⁠ or x64⁠
  3. Install URL Rewrite⁠ for IIS
  4. Install Mongo DB 2.6.7 (or latest)⁠

##Deployment

⁠Configuring database
  1. Run Mongo DB as win service⁠

  2. Create "statements" and "results" collection within "lrs" DB.

    use lrs
    db.createCollection("statements");
    db.createCollection("results");
    
  3. 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 });
    
⁠Installing website
  1. Clone this Git repository locally

  2. Run npm install in the root

  3. 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>
    
  4. 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

  5. Copy folder to the server (without .git and package.json:))

  6. Create Web site in IIS and add corresponding site bindings and permissions

  7. To generate results into results collection from existing data in statements collection install "co" module via npm and run:

    node migration/exec.js

⁠Using a different server to host Mongodb

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.

⁠Securing the LRS

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.

⁠Resources

  1. Hosting node.js applications in IIS on Windows⁠
  2. Getting started with Mongo DB⁠

Tag summary

Content type

Image

Digest

Size

85 MB

Last updated

almost 9 years ago

docker pull wonderlic/easygen-lrs