...
In order to make it easier for the user of this guide I am using the following symbols to identify different types of text.
1. Instructions of new steps
♣ CODE - be careful when you copy and paste and remember it's case insensitive.
• Steps within a step and additional explanation.
Step 1: Creating an EC2 account
First things first: you need to create your AWS account. You can sign up here. You’ll have to provide a credit card as part of the online registration process. Amazon offers a Free Usage Tier, which is great to explore the services and even host USHAHIDI at low traffic without being charged. Check the details here and here for specific information on AWS free usage tier.
Step 2:Launching an EC2 instance
You can start your experiments with a Micro instance because its price structure is very attractive. Meaning its free for the first year However, once your instance gets a few thousand page views a day, your instance will systematically become unresponsive and you will need to restart Apache and/or MySQL. If you expect to receive major traffic to your site you can choose to deploy on a variety of servers from a small instance to an extra large instance.
...
- Choose an AMI in from the Quick Launch Wizard: This tutorial will demonstararte a deployment using Ubuntu Server 12.04 LTS - 64 bit.
- Click on Edit details: Select the Instance Type you want to use. We will chose Micro (t1.micro). You can give your instance a name and determine the shut down behavior.
- Create a new key pair. Enter a name for your key pair (i.e. Tufts) and download your key pair (i.e. Tufts.pem).
- Select the quick start security group.
Step 3:Allocating an elastic IP
On the left side of your screen you can see a column titled Navigation. Under Network and Security, select Elastic IPs. Under Address click on Allocate New Address and select EIP used in: EC2
After the IP is allocated, right click on the IP and select Allocate and select the instance.
Step 4:Installing Ushahidi
Once your instance is running, you can access it using SSH. Secure Shell (SSH) is a network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers that it connects via a secure channel over an insecure network. This is a bit more technical but take a deep breath and you will have an instance running sooner that what you imagined.
...
That’s it! You can access the server with your SSH client and password that you just set.
Step 5: Installing required software:
Run each of these commands separately, it might take some time and require a “Y” once in a while.
Code Block |
---|
apt-get update apt-get upgrade apt-get install apache2 apt-get install php5 apt-get install mysql-server apt-get install curl libcurl3 libcurl3-dev php5-curl apt-get install php5-memcache memcached sudo apt-get install vsftpd apt-get install php5-+cli update-rc.d mysql defaults apt-get install php5-mcrypt php5-curl php5-mysql php5-imap php5-gd a2enmod rewrite apt-get install unzip service apache2 restart |
Step 6: Installing Ushahidi
Create new user and set password
Code Block useradd --create-home --shell /bin/sh ushahidi passwd ushahidi
Login as user and create dir for web files. To switch from root to user use commands below (alternatively you can start new SSH session)
Code Block su - ushahidi mkdir public_html cd public_html
Download the latest version of Ushahidi from https://github.com/ushahidi/Ushahidi_Web/archives/master using the following command:
Code Block wget https://github.com/downloads/ushahidi/Ushahidi_Web/ushahidi-Ushahidi_Web-2.4-0-gb16aee9.zip
Unpack files into
/home/ushahidi/public_html/ushahidi-web
Code Block unzip ushahidi-Ushahidi_Web-2.4-0-gb16aee9.zip mv ushahidi-Ushahidi_Web-2.4-0-gb16aee9 ushahidi-web
Change directory to
/home/ushahidi/public_html/ushahidi-web
Code Block cd /home/ushahidi/public_html/ushahidi-web
Change permissions for files
Code Block chmod -R 777 application/config chmod -R 777 application/cache chmod -R 777 application/logs chmod -R 777 media/uploads chmod 777 .htaccess
Creating a database:
Code Block mysql -u root -p create database ushahidi_web;
NOTE You need to execute command above and enter root password for MySQL (
mysql -u root -p
), you will enter mysql console where you can run commandcreate database ushahidi_web;
to create database.
In the same mysql command line interface you need to run command below to grant permissions for mysql user:Code Block sql grant all privileges on ushahidi_web.* to 'ushahidi_mysql'@'localhost' identified by 'Tufts2012'; flush privileges; quit
Updating apache config to make Ushahidi-web our default web server. In this step you are going into 000-default and replacing the existing with the following. First access the file by writing the following command:
Code Block nano /etc/apache2/sites-enabled/000-default
Then paste in the text below, beginning with
<VirtualHost *:80>
and ending</VirtualHost>
.Code Block <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /home/ushahidi/public_html/ushahidi-web <Directory /home/ushahidi/public_html/ushahidi-web> Options Multiviews FollowSymLinks -Indexes AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
To exit and save you need to use the Ctrol buton in combination with the upper case X. They click Y to save.
- Restart Apache:
...