Linked Data for Applications (LDA)

Composite Apps for the Cloud

Downloading the Software

NOTE FOR OSX USERS:

There is a bug in VirtualBox that can prevent your host networking port mapping from working.

Worse, it can seem like everything is set up right when you look at the VirtualBox admin windows but you’ll still get 503 errors from the webservers.

You have to follow the steps in “Note 1” below (scroll to the bottom of the doc). If you start getting 503 server errors again just go through the steps again.

The easiest way to get started with LDA is to download the framework from github as follows:

  1. Create a working directory:
1
2
mkdir ld4apps # or pick your own name
cd lda4apps
  1. Clone the github repositories:
1
2
3
4
git clone https://github.com/ld4apps/lda-clientlib.git
git clone https://github.com/ld4apps/lda-serverlib.git
git clone https://github.com/ld4apps/lda-siteserver.git
git clone https://github.com/ld4apps/lda-examples.git

The four github repositories should now be in the following subdirectories:

  1. lda-clientlib – Javascript libraries for LDA client application development
  2. lda-serverlib – Python libraries for LDA server application development
  3. lda-siteserver – standard system functions for LDA applications – authentication, access control and multi-tenancy
  4. lda-examples – LDA example applications

There are several sample applications in the lda-examples repository you can look at and run. Note that the 4 repositories must be downloaded in sibling directories, as instructed above, in order to run the examples.

Setting up Database and Reverse Proxy Servers

The LDA framework requires a running back-end database for storing application data. Most non-trivial LDA applications also require a reverse proxy web server configured to route requests to appropriate application subsystems. Currently, LDA uses/supports MongoDB for the database and we usually use Nginx for the reverse proxy server. Before you can do much with the LDA framework, you will need one or both of these servers to be running.

Starting MongoDB

If you are getting started with LDA and just want to follow along with the Todo Sample Tutorial, the fastest way to get set up is to simply go to the MongoDB download page and download the appropriate version for your OS.

Once MongoDB has downloaded, execute the following commands:

1
2
cd <mongodb-installation-directory>/bin
mongod

At this point, MonoDB should be running and listening on its default host and port (localhost:27017). You should now be able to run the ‘Todo Sample’ in the lda-examples repository.

Using Vagrant to start MongoDB and Nginx

If you plan to do more with LDA (for example, run all the examples and start to play with it yourself), rather than installing and running MongoDB, the lda-examples repository includes a Vagrantfile that can be used to start a MongoDB server as well as a properly configured Nginx reverse proxy server.

Before you can use the supplied Vagrantfile, you first need to download/install the following:

  1. Vagrant
  2. VirtualBox
    • Make sure you have a VirtualBox Host-Only Network (IP address 192.168.56.1) configured (see Note 1, below).

Once Vagrant and VirtualBox are installed, execute the following commands:

1
2
cd lda-examples
vagrant up

At this point the mongodb and nginx servers are running and ready for you to start playing with all of the examples. Have fun!

Note 1. Configure VirtualBox Host-Only Network (IP address 192.168.56.1)

On some machines, the following steps are necessary to configure VirtualBox to work correctly for SetupShop. This definitely seems to be needed on Mac, but (some?) Windows machines seem to have this automatically (pre)configured.

  1. Start the VirtualBox app and select VirtualBox / Preferences…
  2. Click the “Network” tab.
  3. Click the “Add host-only network (Ins)” green plus button on the right to add “vboxnet0” to the list of Host-only Networks.
  4. Then click on the screwdriver icon on the right hand side to edit the vboxnet0 settings.
  5. Accept the default IP address (192.168.56.1) settings on the Adapter tab.
  6. Click on the DHCP Server tab.
  7. Ensure that “Enable Server” is NOT checked on the DHCP Server tab. Then click “OK” and “OK” to save the settings.