TurnKey Linux Virtual Appliance Library

TKLPatch for Ushahidi

 

Hi guys! This was a special petition by Jomy Muttathil, and other community members including me felt this appliance is important for what it does. So here it is, so you can test it and give some feedback. 
 

Known issues

- A message appears in pages where google map is used, telling "This web site needs a different Google Maps API key. A new key can be generated at http://code.google.com/apis/maps/". I'll investigate about it later to see if it's possible to obtain an API key via an script. 
- I wanted to redirect /admin to ssh, but couldn't get it working and I decided not to delay the release. 
 

Features

- Ushahidi software
- http and https access enabled. 
- User/pass: admin/admin
 

What it does

1. Set Hostname
HOSTNAME=ushahidi
echo "$HOSTNAME" > /etc/hostname
sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts
hostname ushahidi
2. Update package information
apt-get update
 
3. Install required packages
install apache2 mysql-server php5 php5-mysql php5-curl php5-mcrypt libapache2-mod-auth-mysql
 
4. Untar ushahidi
tar xzf /usr/local/src/ushahidi.tgz -C /var/www/
 
5. Set permissions
chmod 777 /var/www/ushahidi/application/config/config.php
chmod 777 /var/www/ushahidi/application/config
chmod 777 /var/www/ushahidi/application/cache
chmod 777 /var/www/ushahidi/application/logs
chmod 777 /var/www/ushahidi/media/uploads
chmod 777 /var/www/ushahidi/.htaccess
 
6. Create database and user
mysqladmin -u root create ushahidi
mysql -u root <<-END_PRIVS
GRANT ALL PRIVILEGES ON ushahidi.* TO ushahidi@localhost IDENTIFIED BY "ushahidi";
flush privileges;
END_PRIVS
 
7. Configure ushahidi
cp /var/www/ushahidi/application/config/database.template.php /var/www/ushahidi/application/config/database.php
sed -i "s/username/ushahidi/" /var/www/ushahidi/application/config/database.php
sed -i "s/password/ushahidi/" /var/www/ushahidi/application/config/database.php
sed -i "s/db/ushahidi/" /var/www/ushahidi/application/config/database.php
 
8. Fix a bug in ushahidi sql script. There are some typos with a field name. I reported the error here
sed -i "s/\`int\`/\`id\`/" /var/www/ushahidi/sql/ushahidi.sql
 
9. Create database tables
mysql -u root ushahidi < /var/www/ushahidi/sql/ushahidi.sql
 
10. Enable apache modules
a2enmod rewrite ssl
 
11. Enable sites
a2dissite default
a2ensite ushahidi
a2ensite ushahidi-ssl
 
12. Clean
apt-get clean
 
Enjoy!
Attached: 

Kudos

Nice job making this appliance, which I think we all agree can do tremendous good, a priority matter. I look forward to trying the patch out.


Jomy Muttathil's picture

Lucid Core or Lucid LAMP

It looks like this is intended to patch TKL Lucid Core.

Is there a reason it is not using the TKL Lucid LAMP patch?

There's no official TKL Lucid LAMP yet

That's why my patches always are aimed to patch TKL Lucid Core. I know Basil did a TKLPatch for Lucid LAMP that I could chain into this one, but I prefer to wait until the official images are out to update this patch and base it on LAMP. Chaining the patches has the same effect if what you are looking for is to download less packages from the net. 

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)