Skip to content
FLawrence edited this page Jun 23, 2015 · 40 revisions

Links

On Virtual Machine

Webfiles:

  • /home/minion/snapcode (Git Checkout)
  • Main python file for person page: /home/minion/snapcode/django/root/sparqlquery/views.py
  • Main template file for person page: /home/minion/snapcode/django/root/sparqlquery/templates/person.html

RDF Files:

  • /home/minion/snapdata

Useful Commands

Command Line: http://www.pixelbeat.org/cmdline.html

GIT Commands: https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf

When you change a django page you need to run the following command for it to be loaded:

sudo apachectl graceful

HowTos

Setting Up A Dev VM

The Short Version

  1. Download and install VirtualBox
  2. Download VM Iso from https://drive.google.com/file/d/0Bzn6JMdk_8E8ZHU4NmU4X3Racjg/view?usp=sharing (NB. This file is 1.5Gb!)
  3. Either double-click on the file (VirtualBox should be the default program that it wants to open with) or in VirtualBox go to 'File' menu and select 'import appliance'
  4. It will do a (long) install, then it will try and run and then it will get upset because some of the settings will be slightly different from the machine that it was created on. Go for the default options it offers you as an alternative and it should work.
  5. The VM with everything setup should now be running

In the VM

  • Default log in details:

username: minion

password: Pwede na?

[THIS DOESN"T WORK ON THE KCL NETWORK]

  • ifconfig

  • Get inet address of eth0 - this is the url for the site. Going to this page in your browser should result in a web page
  • In a browser go to: http://[what-it-said-the-inet-number-was]/person/[number]

[FOR THE KCL NETWORK]

  • sudo nano /etc/network/interfaces

  • Add the following lines at the bottom of the file:

    auto eth1

    iface eth1 inet dhap

  • Close and save the file

  • Turn off the VM

  • In VirtualBox open the settings for the VM

  • Under the Network tab:

  • Change Adaptor 1 to NAT

  • Enable the second adaptor and make it Host Only Adaptor

  • Start the VM

  • ifconfig

  • Get inet address of eth1 - this is the url for the site. Going to this page in your browser should result in a web page

The Long Version

The Basic VM

  1. Download and install VirtualBox
  2. Download (latest) Ubuntu iso and put it somewhere sensible

In VirtualBox:

  • Create new virtual machine (select Linux, Ubuntu64 options - then go with all the defaults)
  • Run the new VM - you should be prompted to select a drive option. Select the iso (wherever you put it)
  • Select the language of your choice and press return
  • Select 'Install Ubuntu Server'
  • Select language and keyboard as applicable
  • Set up account as prompted
  • Partition type: full disk
  • Do not set up a proxy for network access
  • Install OpenSSH and LAMP when given the option
  • set MySQL root password (part of LAMP setup)
  • complete installation
  • Select VM and open settings. In Network tab, change 'Attached to' option to "Bridged Adaptor"
Helpful Links

SNAP on Your VM

In VM:

  • log In

  • sudo apt-get install python-django

  • sudo apt-get install libapache2-mod-wsgi

  • sudo apt-get instal git

  • cd

  • git clone https://github.com/SNAPminions/snapcode.git

  • sudo nano /etc/apache2/sites-enabled/000-default.conf ** In 000-default.conf add

     At the top of the file:
     
     WSGIScriptAlias / /home/minion/snapcode/django/root/apache/wsgi.py
     WSGIPythonPath /home/minion/snapcode/django/root
     
     At bottom of virtualHost definition:
     
     <Directory /home/minion/snapcode/django/root/apache>
     <Files wsgi.py>
     Order allow,deny
     Require all granted
     </Files>
     </Directory>
    
  • sudo service apache2 restart

  • ifconfig Get inet address of eth0 - this is the url for the site. Going to this page in your browser should result in a web page

  • sudo apt-get install 4store

  • mkdir -m 0777 /var/lib/4store (This is a bit insecure but this is only running in the VM so not a major issue)

  • 4s-backend-setup snap

  • mkdir /home/minion/snapdata

  • sudo apt-get install subversion

  • cd /home/minion/snapdata

  • svn checkout https://scm.cch.kcl.ac.uk/svn/snapdrgn/data/RDF (you need a ldap account with the necessary permissions to do this)

  • 4s-backend snap

  • 4s-import snap -v -M http://pir RDF/pir/PIR*

  • 4s-import snap -v -M http://tm RDF/tm/TM*

  • 4s-import snap -v -M http://lgpn RDF/lgpn/lgpn*

  • 4s-import snap -v -M http://bm RDF/bm/bm*

  • 4s-import snap -v -M http://viaf RDF/viaf/viaf*

  • 4s-httpd -p 9000 snap

  • sudo nano /etc/default/4store ** In file: set default port to 9000 set default knowledge base to "snap"

Helpful Links