3,718 bytes added
, 12:04, 11 December 2008
=Activities.sugarlabs.org=
Over the last several months, there have been on and off discussions about how to adapt the addons.mozilla.org server 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.s.o is exactly the same as the desired functionality of a.m.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 serer-gui in a virtual machine.
===Set up Apache===
Apache is preinstalled on CentOS.
Configure Apache to start on system boot.
<code>
chkconfig --levels 235 httpd on
</code>
===Create Apache test page===
<code>
vim /var/www/html/index.php
<?php phpinfo(); ?>
</code>
===Start Apache===
<code>
service httpd start
</code>
===Install Firefox===
<code>
yum install firefox
</code>
===Test 127.0.0.1===
verify mod_rewrite and mod_expires are loaded
===Set up php===
look for PHP5.1.6
<code>
rpm -q php
</code>
look for php-gettext ( in php-common)
<code>
rpm -q php-common
</code>
install required php modules
<code>
install php-pear
install php-gd
install php-mbstring
pear config-set preferred_state beta
pear install Archive_Zip
</code>
===Install subversion===
<code>yum install subversion</code>
===Checkout amo trunk via svn===
<code>svn co http://svn.mozilla.org/addons/trunk /var/www</code>
===Install mysql===
<code>
yum install mysql-server
yum install php-mysql
</code>
===start mysql on system boot===
<code>
chkconfig --levels 235 httpd on
</code>
==Start mysqld===
<code>
service mysqld start
</code>
===Setup mysql===
<code>
mysqladmin -u root passward 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';
</code>
===Populate tables===
<code>
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
</code>
===Set up server===
===Edit DocumentRoot===
<code>
cd /ect/httpd/conf/httpd.conf
Edit DocumentRoot /var/www/site/app/webroot
Edit AllowOverrides All
</code>
===Set permissions===
<code>
chown -R apache:apache app/webroot/files
chown -R apache:apache app/tests/data
chown -R apache:apache app/tmp
</code>
===Configure aso===
===Edit config.php===
<code>
cp /var/www/site/app/config/config.php/default /var/www/site/app/config/config/php
vim /var/www/site/app/config/config.php
</code>
===Edit config-local.php===
<code>
vim /var/www/site/app/config/config-local.php
</code>
===Create repo directories===
<code>
mkdir /var/www/files
mkdir /var/www/files/temp
mkdir /var/www/files/extracted
chown -R apache:apache /var/www/files
</code>
===Add to hosts===
<code>
vim /etc/hosts
127.0.0.1 activities.sugarlabs.org
</code>
===Install php-memcache===
<code>
yum install php-devel
yum install gcc
yum install zlib-devel
pecl install memcache
vim /etc/php.ini
</code>
===Install memcached===
<code>
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
</code>