Web Platform for MRC Outreach Events

From MRC Centre for Outbreak Analysis and Modelling
Jump to navigation Jump to search

Introduction

This page describes steps to install web server software, and a website that supports the Barcode Epidemic and Herd Immunity tools we use in public events. Any web server and router will do for this, but below is how I set up our current kit, and the instructions should be fairly easily modified if you want to do this on different hardware or software.

Install a Web Server

I like Abyss X1:- it's simple, very lightweight, and there are versions for all platforms. By all means, setup another web server if you prefer, but this one has served very well. Instructions below are for both Windows and Mac; if you use Linux, you'll probably figure out the very simple requirements. My instructions here are very simple - change locations to how you like if you're happy doing that.

Installing Web Server Software

Abyss1.jpg
Abyss2.jpg
Abyss3.jpg
Epiweb.jpg

Download Abyss

Download from here for your platform; Windows, Mac or Linux.

  • On Windows: - I installed to C:\Abyss, for simplicity. I tell it to install as a Windows service, and have it start up automatically.
  • On Mac: - I mounted the installer, dragged the Abyss Web Server folder into my Applications folder, then tried to run the Abyss Web Server app from new folder I'd just dragged. It complained at me because it didn't come from the App Store, so I had to use Control+Click to run the app, and confirm I knew what I was doing. Also on running the Web Server, it asked me to confirm I wanted it to Activate ports below 1024 - to which I said Yes, to make it run like a normal web server. If you want the web server to start automatically rather than having to start it yourself every time, then while the app is in focus, click on Server on the top menu, then Startup Configuration on the top menu bar, and choose the automatic startup option. If you want to stop it from being automatic, just manually run it again with a control+click, and you'll get the same menu back at the top.

Download PHP

Aprelium provide convenient downloads for Windows and Mac here. PHP 5 is fine.

  • On Windows: - I installed into C:\Abyss\PHP5.
  • On Mac: - Again, I mounted the installer, and dragged the PHP5 folder into Applications.

First-time Setup

  • Open any browser and go to 127.0.0.1:9999. You should get the Abyss First-time Configuration page. Choose your Language (I'll be describing English!). Then choose a user and password, which is specific to managing Abyss. Make a note of it, although you won't need it much.
  • On Mac: - At this point for me, Safari got its knickers in a twist and I had to manually restart it. If it brings up a login screen, carry on, but if it seems to not do anything, then restart Safari and browse to 127.0.0.1:9999 again.
  • Your browser should now be asking you for the user/password you just chose. If you get it right, you'll get to the Web Server config page, and see a bunch of icons.

Configure for PHP

  • In the middle, you'll see "Default Host Running on Port 80." Click Configure next to it, and then Scripting Parameters. Ensure Enable Scripts Execution is ticked, and Type is set to standard. Then under Interpreters, click Add, set Interface to FastCGI (Local - Pipes), and for Interpreter, you need to locate a file "php-cgi" - where you installed PHP. For Windows: something like C:\Abyss\PHP5\php-cgi.exe, for Mac: /Applications/PHP5/bin/php-cgi.
  • Then in Associated Extension, click Add, and add the extension php. Click Ok, and Ok again.
  • You should be back at the icons page. Go to Index Files, and add index.php. Ok, and ok again.
  • And press the Restart button it is offering you. Wait a few seconds, and the config page will reappear. But you're all done now, so you can close it once it's done.

Setting up the Epi Website Platform

  • First, clear out the default website Abyss came with. If you everything as I did above, then on Windows it'll be in C:\Abyss\htdocs; on Mac: /Applications/Abyss Web Server/htdocs.
  • So delete the files in that folder, and download the Epi Website (v1.2, 17/01/17) here. Extract that zip file into the relevant folder; you should see a file index.php and a folder epi within the htdocs' folder.
  • And that's it. (Versions before 1.1 had a configuration step - but that's automatic now).

Router and Wireless Connectivity

Dl2.jpg
Dl3.jpg

The Belkin has gone, the D-Link has come. The router is a D-Link DIR-868L, which works fine. Mostly, you'll just have to plug it in, and push the button on the back, and wait for the mrc_outbreaks wifi network to appear. The D-Link is already configured, so I won't describe that here; but all you need if you set this up on another router, is a wifi network, and to ensure that your web server always gets the same IP. I configured the D-Link so that tablets would get the set IP addresses too, although that shouldn't really matter.

To add a server or tablet to the router's DHCP

  • Connect to the mrc_outbreaks wifi, or attach to the router with a network cable.
  • Browse to 192.168.2.1, and login with admin, and the secret password which you get by contacting Wes, or IT.
  • Click on NETWORK SETTINGS on the left, and scroll down to ADD DHCP RESERVATION.
  • Feed it a name, the IP address, and the MAC Address of the new machine. Don't know the MAC address?
    • On Windows, open a Command Prompt, and ipconfig /all |more. It will list all your network connections - look for Physical Address for the right one.
    • On Mac, open a Terminal Window, and ifconfig - look for the right network connection, and the MAC address starts with ether.
    • You may have more than one network card - for example, wireless and wired. But you should be able to guess which one from the text that ipconfig or ifconfig gives you.
    • On Android, Something like Apps, Settings, and under System, About Device, and Status. Look for Wi-Fi MAC address.
  • Tick the enable box, and click the Add/Update button.
  • In the instructions here, I'm going to assume the web server's IP address is 192.168.2.2 - this obviously might be different on your setup, or if we add more web server machines to the router's DHCP table.

Test Everything

  • Open a browser on the web server machine, and go to http://127.0.0.1/epi - check you can see the website. If you can't, go back to the Abyss Installation.
  • Now, on the web server laptop, join the mrc_outbreaks wireless network, and find out the IP address using ipconfig or ifconfig.
  • Suppose for example your server IP is 192.168.2.2. Open a browser, and go to http://192.168.2.2/epi - can you still see the website? You should be able to. If not, it would be something mysterious to do with the Web Server setup, or perhaps not enabling the low-numbered ports on a Mac.
  • Finally, use a tablet, or another machine. Join the mrc_outbreaks network, and browse to http://192.168.2.2/epi (assuming that's what the IP was). If you get the website, you're fine. If you get an error, but the previous step worked ok, then you probably have to do something with the Firewall on the web server machine, as it's preventing other machines from accessing it. You need to allow incoming and outgoing data on port 80.