From MozillaWiki
< IT‎ | Community
Jump to: navigation, search
Module Name Module Owner ewong

Summary is a site where anyone can create a series of Open Badges to recognize skills, achievements and interests. This platform is available for free and intended to provide an easy option for issuing interoperable badges that align with the Open Badges metadata standard.



  • AWS
    • Compute Region (AZ):
  • RDS:
  • ELB



Web servers

Name Service Flavor IP Addr
badge-us-01 web standard.medium
badge-us-02 web standard.medium

Set Up

(Please note: This is a WIP.]

  • Spin up instance using image.
    • The database is on the DBaaS, so it's already installed and setup. Just need to point these instances to it.
  • Create badger user account.
 sudo useradd badger
 sudo usermod -a -G wheel badger
 sudo chmod o+x /home/badger
  • sudo install packages:
 sudo yum install gcc
 sudo yum install httpd
 sudo yum install mod_wsgi
 sudo yum install git
 sudo yum install memcached
 sudo yum install python-devel
 sudo yum install mysql-devel
 sudo yum install python-pip
 sudo yum install mysql
 sudo yum install libjpeg
 sudo yum install libjpeg-devel
  • setup virtualenv
 sudo pip install virtualenv
 virtualenv ./dj
 source ./dj/bin/activate
  • pip install some modules
 pip install python-memcached
 pip install PIL
 pip install reportlab
  • get source and get submodules
 git clone badgus
 cd badgus
 git submodule update --init --recursive
  • setup database info on
 cd badgus/settings
 sudo cp /root/files/ .
 sudo chown badger.badger
  • edit
 STATIC_ROOT = 'static/'   # <-- add this line
 MEDIA_ROOT = '/var/www/html/media'  # <-- add this line
      'default': {
            'NAME': 'badge',       # <-- modify this
            'USER': 'badge',       # <-- modify this
            'PASSWORD': '<password>',   # <-- modify this
            'HOST': '',     # <-- modify this
      ('<admin name>', '<admin email>'),   # <-- modify this line
 BADGER_ALLOW_ADD_BY_ANYONE = True  # <-- find this line and change it
  • collect static files
    • in /home/badger/badgus
    • (enter yes when asked "Are you sure you want to do this?")
  ./ collecticstatic
  sudo mv ./static /var/www/html
  • Setup Apache
    • sudo vi /etc/httpd/conf/httpd.conf
      • Add the following lines to the bottom of the httpd.conf file:
    AddHandler wsgi-script .wsgi

    NameVirtualHost *:80

    Alias /media "/var/www/html/media"
    Alias /static "/var/www/html/static"

    WSGISocketPrefix /var/run/wsgi

    <VirtualHost *:80>
       ServerName      # <-- change this

       <Directory "/var/www/html/media">
         Order deny,allow
         Allow from all

       WSGIDaemonProcess user=badger group=badger threads=25 python-path=/home/badger/badgus:/home/badger/badgus/badgus

       <Directory "/var/www/html/static">
         Order deny,allow
         Allow from all

       WSGIScriptAlias / /home/badger/badgus/wsgi/playdoh.wsgi

       <Directory "/">
         Options FollowSymLinks
         AllowOverride None
         Order deny,allow
         Allow from all

       <Directory "/home/badger/badgus/badgus">
         Order allow,deny
         Allow from all
  • Under Apache's /var/www/html
    • If you have the images file (from
      • Uncompress the images file to /var/www/html/media
      • sudo chown -R badger.badger /var/www/html/media/uploads
      • sudo chmod -R 775 /var/www/html/media/uploads
    • If you are starting new:
      • sudo mkdir /var/www/html/media /var/www/html/media/uploads /var/www/html/media/uploads/{awards|badge|profile}
      • sudo chown -R badger.badger /var/www/html/media/uploads
      • sudo chmod -R 775 /var/www/html/media/uploads
  • Edit /home/badger/badgus/wsgi/playdoh.wsgi
    • add the following lines after "import site"
  import sys
    • add the following lines to this file after "site.addsitedir(os.path.abspath(os.path.join(wsgidir, '../')))
  sys.path.insert(0, '/home/badger/badgus')
  sys.path.insert(0, '/home/badger/dj/lib/python2.6/site-packages')

  • Run instructions
 cd /home/badger/badgus
 ./ syncdb
 ./ migrate
  • Final touches:
 sudo service memcached start
 sudo service httpd start
 sudo chkconfig memcached on
 sudo chkconfig httpd on
  • [TODO] Set up using glusterfs to synchronize each instance's media/ folders.

Configuration files

  • /home/badger/badgus/badgus/settings/