Activity Library/Devel/Installing

Activities.sugarlabs.org

Over the last several months, there have been on and off discussions about how to adapt the addons.mozilla.org server software to manage Sugar activities.

Background

Information about Remora, the codename for a.m.o version 3, is at https://wiki.mozilla.org/Update:Remora.

Why base a.s.o on a.m.o

Pros

  • The function of a.m.o is exactly the same as the desired functionality of a.s.o.

Cons

  • A.m.o is currently only used my mozilla.
  • A.m.o is written in cake-php (yet another web framework)

Installing activities.sugarlabs.org

Mozilla.org runs a.m.o on CentOS5.0. For capability reasons these instructions will also use CentOS5.2.

Install centOS5.2 as server

It is handy to set up a development system as a server-gui in a virtual machine.

Set up Apache

Apache is pre-installed on CentOS.

Configure Apache to start on system boot.

chkconfig --levels 235 httpd on

Create Apache test page

vim /var/www/html/index.php
<?php phpinfo(); ?>

Start Apache

service httpd start

Install Firefox

yum install firefox

Test 127.0.0.1

verify mod_rewrite and mod_expires are loaded

Set up php

look for PHP5.1.6

rpm -q php

look for php-gettext ( in php-common)

rpm -q php-common

install required php modules

install php-pear
install php-gd
install php-mbstring
pear config-set preferred_state beta 
pear install Archive_Zip

Install subversion

yum install subversion

Checkout amo trunk via svn

svn co http://svn.mozilla.org/addons/trunk /var/www

Install mysql

yum install mysql-server
yum install php-mysql

start mysql on system boot

chkconfig --levels 235 mysqld on 

Start mysqld

service mysqld start

Setup mysql

mysqladmin -u root password remora
mysqladmin -u root -p create remora
mysqladmin -u root -p create remora-test
mysql -u root -p
GRANT ALL ON *.* TO 'remora'@'localhost' IDENTIFIED BY 'remora'; 

Populate tables

mysql -u remora -p -D remora </var/www/site/app/config/sql/remora.sql
mysql -u remora -p -D remora-test </var/www/site/app/config/sql/remora.sql
mysql -u remora -p -D remora </var/www/site/app/tests/data/remora-test-data.sql
mysql -u remora -p -D remora-test </var/www/site/app/tests/data/remora-test-data.sql

Set up server

Edit DocumentRoot

cd /etc/httpd/conf/httpd.conf

Edit DocumentRoot /var/www/site/app/webroot
Edit AllowOverrides All

Set permissions

chown -R apache:apache app/webroot/files
chown -R apache:apache app/tests/data
chown -R apache:apache app/tmp 

Configure aso

Edit config.php

cp /var/www/site/app/config/config.php/default /var/www/site/app/config/config/php
vim /var/www/site/app/config/config.php

Edit config-local.php

vim /var/www/site/app/config/config-local.php

Create repo directories

mkdir /var/www/files
mkdir /var/www/files/temp
mkdir /var/www/files/extracted
chown -R apache:apache /var/www/files

Add to hosts

vim /etc/hosts
127.0.0.1 activities.sugarlabs.org

Install php-memcache

yum install php-devel
yum install gcc
yum install zlib-devel 
pecl install memcache
vim /etc/php.ini

Install memcached

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
service memcached start
chkconfig --levels 235 httpd on