Machine/aslo-web: Difference between revisions

Dfarning (talk | contribs)
m add dirs
 
(19 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==php==
== Hostnames ==
hostname:  aslo-web.sugarlabs.org
ip address: 140.186.70.123


==Set up==
* http://aslo-web.sugarlabs.org (host not found --[[User:Quozl|Quozl]] ([[User talk:Quozl|talk]]) 03:11, 9 August 2018 (EDT))
Below is the recipe that we used to set up the php server. Please see machine for up to date configuration details.


===Install needed packages===
== Hardware ==
sudo apt-get install apache2 php5 php5-gd php5-cli php-pear php5-mysql
 
sudo apt-get install git subversion
* KVM VM
sudo apt-get install gettext
 
== Location ==
 
[[Machine/housetree|Housetree]]
 
== Admins ==
 
* [[User:alsroot|Aleksey Lim]]
 
== Backups ==
 
<!--* Daily system-full-backup to [[Machine/backup]]. Ask admins for encryption password.
* Daily system-remote-backup to [[Machine/backup]]. Encrypted with keys of bernie and dfarning.-->
 
== Setup ==


===Install required php modules===
===Install required php modules===
Line 16: Line 27:


===Create user to run scripts===
===Create user to run scripts===
sudo useradd -d /srv/activities activities
Make sure that all files in /srv/activities
Make sure that all files in /srv/activities
* has apache(web-data) user
* has apache(web-data) user
Line 28: Line 37:
  sudo -i -u activities
  sudo -i -u activities


===Checkout ASLO sources===
===Set up NFS mount points===


git clone git://git.sugarlabs.org/slo-activities/mainline.git ~
git checkout production -b production
===Fetch external dependencies===
cd ~/site/vendors/
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
===Set up NFS mount points===
Create directories
Create directories
  mkdir -p ~/files
  mkdir -p ~/files
Line 52: Line 48:
  sunjammer.sugarlabs.org:/srv/nfs/activities/staging /srv/activities/staging nfs rsize=8192,wsize=8192,timeo=14,intr
  sunjammer.sugarlabs.org:/srv/nfs/activities/staging /srv/activities/staging nfs rsize=8192,wsize=8192,timeo=14,intr


Restart the nfs server
===Clone ASLO repository===
sudo /etc/init.d/nfs-kernel-server restart


Also aftter making changes to /etc/exports in a terminal you must type
git clone git://git.sugarlabs.org/slo-activities/mainline.git -b production .
sudo exportfs -a


===First-time ASLO setup===
===Checkout dependencies===
 
cd ~/site/vendors/
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
 
==ASLO configuration==


Using ''~/aslo/config.php'' as template, setup ASLO settings in file ''~/site/app/config/config.php''. Template file was configured for ''dev'' environment, switch it to production by  setting ''SITE_STATE'' variable to ''production''.
Using ''~/aslo/config.php'' as template, setup ASLO settings in file ''~/site/app/config/config.php''. Template file was configured for ''dev'' environment, switch it to production by  setting ''SITE_STATE'' variable to ''production''.
Line 67: Line 69:
  define('QUERY_CACHE', true);
  define('QUERY_CACHE', true);


Create directories
All local configuration should happen in files
  mkdir -p ~/site/app/tmp/cache/persistent
  ~/site/app/config/config.php
mkdir -p ~/site/app/tmp/cache/models
  ~/site/app/config/config-local.php
mkdir -p ~/site/app/tmp/cache/views
 
Minify css/js stuff
~/aslo/minify.py
 
Merge ASLO gettext strings
  ~/aslo/po-compile.sh
 
===Crontab for activities user===
 
@daily  $HOME/aslo/cron/daily
@hourly $HOME/aslo/cron/hourly
 
===Create vhost===
vim /etc/apache2/sites-available/activities.sl.org
<pre>
<VirtualHost *:80 *:443>
        ServerName activities.sugarlabs.org
        ServerAlias activities2.sugarlabs.org # for test/install
        ServerAdmin webmaster@sugarlabs.org
 
        DocumentRoot /srv/activities/site/app/webroot
 
        LogFormat "%h %V %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" \"%{HTTP_COOKIE}i\"" addons
        CustomLog /srv/activities/data/access addons
        CustomLog /var/log/apache2/all-access.log vhost_combined
        #CustomLog /var/log/apache2/performance.log performance
</VirtualHost>
</pre>


===Log rotate===
==Update ASLO repository==


===Parse logs===
git pull origin production