Ushahidi Installation Instructions

From Foss2Serve
Revision as of 21:29, 6 June 2013 by Srebelsky (Talk | contribs)
Jump to: navigation, search

This page is under development. It is an attempt to record the strategy we used in the POSSE2013 workshop.

Contents

Set up a Virtual Machine

We use the Harvard CS50 appliance. It's a nice, relatively complete, small Red Hat virtual machine. In addition to the full LAMP (Linux, Apache, MySQL, PHP) stack, it includes many of the things you would want for your students as they develop Web stuff. The Harvard CS50 site also has some nice basic Linux administration exercises.

The primary account is jharvard and the password is crimson.

We are running it with Virtual Box.

  1. Download [ttps://www.virtualbox.org/ VirtualBox]. You'll need to choose the version appropriate for your machine.
  2. Download Version 3 of the Harvard CS50 Applicance
  3. Unzip the CS50 Appliance file. You should see ...
  4. Install Virtual Box
  5. Import the appliance into VirtualBox. If you need help, refer to the reference page for the CS50 Appliance under VirtualBox. It will probably take about fifteen minutes (at least it did for some of us).
  6. You may have to configure the network. There are troubleshooting instructions on the reference page for the CS50 Appliance under VirtualBox.
  7. Start the machine.
  8. Once the machine has started, you can install Guest Additions under Virtual Box. Ideally, that will let you copy files between OS's and let the resolution of the guest machine match the size of the window you give it. (Unfortunately, those of us working on Macs could not get the guest additions to work reliably.)

Congratulations! You have a virtual machine in which to play.

Set Up Web Server

Before we go about installing Ushahidi, we want to make sure that the Web server, PHP, and MySQL work correctly. If you're not familiar with Apache, it tends to look for a user's Web materials in the public_html directory. So you need to make that directory.

 $ cd /home/jharvard
 $ mkdir public_html

However, by default, Linux keeps things private. And private means that no one, not even the Web server, can access them. So you need to make things public. Ideally, the home directory should not be readable. But it needs to grant access to the public_html subdirectory. In Linux terms, it needs to be "world executable". The public_html directory needs to be both readable and executable (that is, people need to be able to see what files are there and to read those files).

 $ cd /home/jharvard
 $ chmod go+x .
 $ chmod go+rX public_html

We need a sample file. So let's create a very simple index.html. (Please don't be offended at the inadequate HTML. This example is intended to be a quick and dirty hack.

 $ cd /home/jharvard/public_html
 $ cat > index.html
 <html>
 <head>
 <title>Welcome to the example</title>
 </head>
 <body>
 Welcome to the machine.
 </body>
 </html>
 ^D

In case you didn't know, ^D represents hitting the Control key and the D key simultaneously.

Again, this file is private by default, so we need to make it public.

 $ chmod a+r index.html

We're now ready to test whether the Web server is running. Believe it or not, but you can test this on your host machine (that is, your real computer, not the virtual one). Start by finding the IP address of your virtual machine. It should be in the lower-right-hand corner of the screen. It's probably something like 192.168.56.101.

In the Web browser on your host machine, go to http://192.168.56.101/~jharvard (change the IP address to the address that shows up in your host machine). You should see a Web page.

If you Web server doesn't run, type

 $ sudo service httpd start

Check the PHP Installation

We're getting there. Now, we need to create a file that shows what php

 # cd /home/jharvard/public_html
 # cat > info.php
 <?php
 phpinfo()
 ?>
 ^D
 # chmod a+r info.php

Visit the page in your browser at http://192.168.56.101/~jharvard/info.php. You should see a list of PHP packages that have been installed.

Once you've tested this, you should get rid of the info.php file because it tells hackers a lot about your system. (It doesn't matter for our private virtual install, but it's still a good habit to get into removing such files.)

Create Database in MySQL

We're going to create the database using the Web admin interface. This is a good way to create a database quickly without getting into nitty-gritty details, SQL etc.

Open up your Web browser in the host machine. Go to http://192.168.56.102/phpMyAdmin/ (you may have a slightly different IP address).

For some reason, life is complicated if you don't prefix the name of the database with the name of the user. So create a database with name beginning with jharvard_ You might want to use "jharvard_ushahidi".

Download and Install Ushahidi

Get Ushahidi code from website ([1]) or github ([2]).

Extract zip file within VM otherwise you’ll need to sftp the files.

You can find detailed installation instructions through a Google Search. However, some Ushahidi installation guides have too much information. Possible assignment for students can be to create a new guide.

Copy the ushahidi directory to 'public_html' directory.

In browser (outside virtual machine) navigate to http://192.168.56.101/~jharvard/ushahidi to test if this worked.

Ensure that files in the Ushahidi 'media' directory have read and execute permissions for 'other' users. chmod –R go+w media - changes recursively inside directory

Click on 'Get Started'

Be sure to use an easy to find database name. Also use an easy to find site name – preferably related to project, city, etc.

Admin user name can be anything but must look like a valid email address (e.g. jharvard@example.edu)

Configure Ushahidi

Add a Twitter Feed

Personal tools
Namespaces
Variants
Actions
Events
Learning Resources
HFOSS Projects
Evaluation
Navigation
Toolbox