Changes

Line 1: Line 1:  +
<noinclude>{{TOCright}}</noinclude>
 +
 
=Activities.sugarlabs.org=
 
=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.
 
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.
Line 10: Line 12:     
=== Cons ===
 
=== Cons ===
* A.m.o is currently only used my mozilla.
+
* A.m.o is currently only used by mozilla.
 
* A.m.o is written in cake-php (yet another web framework)
 
* A.m.o is written in cake-php (yet another web framework)
   −
== Installing activities.sugarlabs.org ==
+
== Sources ==
 
  −
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.
+
http://git.sugarlabs.org/projects/slo-activities
   −
<code>
+
Branches structure:
chkconfig --levels 235 httpd on
+
* ''master'' branch, last ASLO codebase
</code>
+
* ''master-theme'' rebased to ''master'' branch, last ASLO codebase with sugar theme
 +
* ''v<version>'' branch, released ASLO version
 +
* ''v<version>-theme'' rebased to ''v<version>'' branch, released ASLO version with sugar theme
 +
* ''production'' tag to last stable branch
   −
===Create Apache test page===
+
== Install server ==
 
  −
<code>
  −
vim /var/www/html/index.php
     −
<?php phpinfo(); ?>
+
'''NOTE''' The followed instructions tested on Ubuntu 9.04(Jaunty).
</code>
     −
===Start Apache===
+
Install apache, php and mysql.
 
+
  sudo apt-get install apache2 mysql-server
<code>
+
  sudo apt-get install php5 php5-dev php5-gd php5-cli php-pear php5-mysql
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
      +
Install required php modules.
 
  pear config-set preferred_state beta  
 
  pear config-set preferred_state beta  
 
  pear install Archive_Zip
 
  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>
     −
===Set up server===
+
To check out sources you need git and subversion.
 +
sudo apt-get install git subversion
   −
===Set permissions===
+
Checkout our fork.
 +
git-clone git://git.sugarlabs.org/slo-activities/mainline.git /var/www
   −
<code>
+
Fetch external dependencies:
  chown -R apache:apache /var/www/site  
+
  cd /var/www/site/vendors/
</code>
+
svn co http://svn.mozilla.org/libs/product-details
 +
svn co http://svn.mozilla.org/libs/fizzypop.mozdev fizzypop
 +
svn co http://svn.mozilla.org/libs/phorms
 +
svn co http://svn.mozilla.org/libs/zxtm-api
   −
===Edit DocumentRoot===
+
== Set up server ==
   −
<code>
+
Setup apache. Add followed lines to the end of VirtualHost section in /etc/apache2/sites-enabled file:
vim /etc/httpd/conf/httpd.conf
+
  DocumentRoot /var/www/site/app/webroot
+
  <Directory /var/www/>AllowOverride All</Directory>
  Edit DocumentRoot /var/www/site/app/webroot
  −
  Edit AllowOverride All
  −
</code>
     −
===Add to hosts===
+
Enable all apache mods.
 +
cd /etc/apache2/mods-enabled
 +
ln -s ../mods-available/* .
   −
<code>
+
Setup mysql(you need to enter mysql root password for these commands).
vim /etc/hosts
  −
127.0.0.1 activities.sugarlabs.org
  −
</code>
  −
 
  −
===Test server===
  −
 
  −
<code>
  −
service httpd restart
  −
</code>
  −
 
  −
<code>
  −
mv /var/www/site/app/webroot/index.php /var/www/site/app/webroot/index.php.old
  −
mv /var/www/html/index.php /var/www/site/app/webroot/index.php
  −
</code>
  −
 
  −
open activities.sugarlabs.org in firefox
  −
 
  −
===Install mysql===
  −
<code>
  −
yum install mysql-server
  −
yum install php-mysql
  −
</code>
  −
 
  −
===start mysql on system boot===
  −
 
  −
<code>
  −
chkconfig --levels 235 mysqld on
  −
</code>
  −
 
  −
===Start mysqld===
  −
 
  −
<code>
  −
service mysqld start
  −
</code>
  −
 
  −
===Test server===
  −
 
  −
<code>
  −
service httpd restart
  −
</code>
  −
 
  −
open activities.sugarlabs.org in firefox.  Make sure mysql is enabled
  −
 
  −
===Setup mysql===
  −
 
  −
<code>
   
  mysqladmin -u root password remora
 
  mysqladmin -u root password remora
 
  mysqladmin -u root -p create remora
 
  mysqladmin -u root -p create remora
mysqladmin -u root -p create remora-test
   
  mysql -u root -p
 
  mysql -u root -p
 
+
 
  GRANT ALL ON *.* TO 'remora'@'localhost' IDENTIFIED BY 'remora';
 
  GRANT ALL ON *.* TO 'remora'@'localhost' IDENTIFIED BY 'remora';
 
  exit;  
 
  exit;  
</code>
     −
===Populate tables===
+
Add our server to /etc/hosts file.
<code>
+
  127.0.0.1 a.sl.o
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>
      +
To test server create /var/www/site/app/webroot/php.php:
 +
<?php phpinfo(); ?>
 +
Open http://a.sl.o/php in browser and make sure mysql is enabled.
   −
===Configure aso===
+
== Configure ASLO ==
   −
===Edit config.php===
+
  cd /var/www
 
+
  aslo/db-create-stub.sh
<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===
+
Open a.sl.o in browser. To login use:
 +
''login'' admin@sugarlabs.org
 +
''password'' test
   −
<code>
+
== Optional steps ==
vim /var/www/site/app/config/config-local.php
  −
</code>
     −
===Create repo directories===
+
====Install php-memcache====
    
<code>
 
<code>
  mkdir /var/www/files
+
  yum install php-devel gcc zlib-devel
  mkdir /var/www/files/temp
+
   
  mkdir /var/www/files/extracted
+
  pecl install memcache
  chown -R apache:apache /var/www/files
+
  vim /etc/php.ini
 
</code>
 
</code>
   −
===Install php-memcache===
+
You should add "extension=memcache.so" to php.ini
    
<code>
 
<code>
  yum install php-devel
+
  service httpd restart
yum install gcc
  −
yum install zlib-devel
  −
pecl install memcache
  −
vim /etc/php.ini
   
</code>
 
</code>
   −
===Install memcached===
+
====Install memcached====
    
<code>
 
<code>
Line 211: Line 110:  
  chkconfig --levels 235 httpd on
 
  chkconfig --levels 235 httpd on
 
</code>
 
</code>
 +
 +
== TODO ==
 +
 +
* Fix search
 +
* Fix downloads
 +
* Lots of testing, debugging and fixing
 +
* Upstream all patches that can make easier future rebases (and have a chance of being accepted)
 +
* Translate our new strings
 +
* Change the design accordingly to the Sugar image