IMPORTANT:
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.
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.
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.
To create a new instance, access the AWS Management Console and click the EC2 tab:
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 Associate and select the instance.
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.
To launch your SSH – right click on your instance and click connect
Once you have created a new instance, the instance will appear under "my instances".
This is the SSH connection. You first need to log on as "Ubuntu" and later create the root sure and password. By following the instructions.
Congratulations, now that you're logged in to your server via SSH you will need to follow the following steps carefully. I can assure you it simpler than what it looks. Good luck!
passwd
/etc/ssh/sshd_config
nano /etc/ssh/sshd_config
or vi /etc/ssh/sshd_config
Save /etc/ssh/sshd_config
and restart ssh server with command:
service ssh restart |
That’s it! You can access the server with your SSH client and password that you just set.
Run each of these commands separately, it might take some time and require a “Y” once in a while.
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 |
Create new user and set password
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)
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:
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
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
cd /home/ushahidi/public_html/ushahidi-web |
Change permissions for files
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:
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 command create 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:
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:
nano /etc/apache2/sites-enabled/000-default |
Then paste in the text below, beginning with <VirtualHost *:80>
and ending </VirtualHost>
.
<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.
service apache2 restart |
The good news is that you are almost done!