Africa@Home BOINCServerInstall

From AIMSWiki

Table of contents


Prerequisites

This page follows from Africa@Home LinuxServerInstall

Tuesday BOINC Server Installation

The BOINC client is packaged, but we can also compile it from source for the latest added functionality. The BOINC server, however, is not packaged and we need to install it from source and with the scripts which the project provides.

Dependencies

We need to install some extra PHP tools, MySQL tools, development tools, and various header files (the -dev packages) which BOINC directly depends on, as well as some recommended tools. You can cut and paste the following line:

sudo aptitude install php5-cli php5-gd phpmyadmin python-mysqldb m4 make autoconf automake1.9 build-essential libssl-dev libmysql++-dev libtool subversion pkg-config

Mutt is an optional command line email client. It is a way you can read your emails on the server during this course. ant is an additional java compilation tool for STDSIM, a BOINCified model we will see during the course. STDSIM will also require python-dev and python-libxml2.

sudo aptitude install mutt ant python-dev python-libxml2

On distributions other than Debian or Ubuntu these packages above might have slightly different names.

BOINC Users and Groups

Add a BOINC administrative user and put that user in the admin group so that it has full sudo rights

sudo adduser boincadm
sudo adduser boincadm admin
sudo usermod -G boincadm -a www-data

Now log into the server as boincadm

ssh boincadm@<hostname>.aims.ac.za

Set up your mysql database (the root password for mysql database):

mysqladmin -h localhost -u root password <mysqlrootpw> 

Give the correct permissions to the boincadm user in the mysql database:

sudo mysql -h localhost -u root -p
> GRANT ALL ON *.* TO 'boincadm'@'localhost';
> SET PASSWORD FOR 'boincadm'@'localhost'=password('YOUR_PASS');
> FLUSH PRIVILEGES;


Getting wxWidgets

(OPTIONAL - Don't do this unless you really really want to. It is only for building the boinc client)

For added functionality you can download and install wxWidgets. The Ubuntu packaged versions for Dapper include only 2.4 and 2.6, but we want 2.8, but we can get a deb package for Ubuntu from the wxWidgets website. Add the third-party repository to your system. Usually such repositories are not simply added to /etc/apt/sources.list, but are put in a separate directory; and you need to import the public key of the key-pair used to sign that repository:

sudo echo "deb http://apt.tt-solutions.com/ubuntu/ dapper main" > /etc/apt/sources.list.d/wxWidgets.list
wget -q http://www.tt-solutions.com/vz/key.asc -O- | sudo apt-key add -
sudo aptitude update
sudo aptitude install libwxgtk2.8-0_2.8.4.0-0_i386.deb

Alternatively, download and install wxGTK from the source:

cd /tmp/
export http_proxy=http://proxy.aims.ac.za:3128/
wget http://heanet.dl.sourceforge.net/sourceforge/wxwindows/wxGTK-2.8.4.tar.gz
tar -zxvf wxGTK-2.8.4.tar.gz
cd wxGTK-2.8.4
mkdir gtkbuild
cd gtkbuild
../configure --with-gtk --disable-shared
make
sudo make install
sudo ldconfig

Get BOINC source

sudo aptitude install subversion
vim ~/.subversion/servers

add in the [global] section:

http-proxy-host = proxy.aims.ac.za
http-proxy-port = 3128

Now use subversion to fetch the source, compile and test it. Normally you would use the repository on berkeleys server, but today we will use a local repository:

NOTE The sanity test will not work due to that we are using a proxy server for all our HTTP connections. The step is not more necessary.
svn co http://shrike.aims.ac.za/svn/trunk/ boinc_trunk
cd ~/boinc_trunk
./_autosetup
./configure --disable-client
make
sudo make install
cd /usr/local/src && sudo ln -s /home/boincadm/boinc_trunk boinc

Server Checks

Try use a browser to connect to http://<hostname>.aims.ac.za

Go to your web server root directory (/var/www/) and create a php test file

sudo nano /var/www/phptest.php

with these contents:

<?php
echo "hello world!";
phpinfo();
?>

Now browse to http://<hostname>.aims.ac.za/phptest.php. You should see your system's PHP.

Using your BOINC server

Create a Project

you should substitute wagtail with your project name fx. SETC (search for extra terrestial chocolate). The test-app flag will setup a test project with a pre-made executable, assimilator, validator and work generator. Tomorrow you will learn how to make your own.

cd ~/boinc_trunk/tools
./make_project --test_app wagtail

You should see this output:

Creating project 'wagtail' (short name 'wagtail'):
   PROJECT_ROOT = /home/boincadm/projects/wagtail/
       URL_BASE = http://wagtail.aims.ac.za/
  HTML_USER_URL = http://wagtail.aims.ac.za/wagtail/
   HTML_OPS_URL = http://wagtail.aims.ac.za/wagtail_ops/
        CGI_URL = http://wagtail.aims.ac.za/wagtail_cgi/
        KEY_DIR = /home/boincadm/projects/wagtail/keys/
        DB_NAME = wagtail
        DB_HOST =

Now copy the web server configuration file to the web server configuration directory:

sudo cp /home/boincadm/projects/wagtail/wagtail.httpd.conf /etc/apache2/conf.d

and restart your web server:

sudo /etc/init.d/apache2 restart

Crontab is your chronological table. It is for jobs which must run periodically. The files are in /var/spool/cron, and each user can edit their own crontab (if you want more help you can check the manual page: man 5 crontab):

boincadm@<hostname>:~$ crontab -e

Add this line

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/boincadm/projects/wagtail/bin/start --cron

The line says to run every five minutes (of every day, weekday, day of month, etc) the command shown on the right.

Even though the test_app flag above installs a test application for you, you must still register this application with your project. To do that:

cd ~/projects/wagtail
bin/xadd
bin/update_versions

To start, show status, and stop the project, run:

bin/start
bin/status
bin/stop

The project's URLs are: Home page (and master URL): http://wagtail.aims.ac.za/wagtail/ Administrative page: http://wagtail.aims.ac.za/wagtail_ops/

The default installed home page index.php has a broken link to the xml.gif file. You will need to fix that by editing this file like so:

nano html/user/index.php
change xml.gif to img/xml.gif

Now you must customise your project slightly by changing the template files to reflect your project specific information.

Edit the following file and make the necessary changes:

nano html/project/project.inc
change PROJECT
change COPYRIGHT_HOLDER

When the server needs to send email to a volunteer, it should originate from an address with a return path and a name. You set those up with the following define statements:

define("EMAIL_FROM","info@yourproject.net");
define("EMAIL_FROM_NAME","info@yourproject.net");

Add these defines to the bottom of the list of define statements in the project.inc file.

Now you can customise your project home page with some information that describes what your project is about, its purposes and goals. This is done in the index.php file:

nano html/user/index.php

As a security feature, no-one is able to attach to your newly created project until you take some action to make this possible.

nano config.xml
change <disable_account_creation> from 1 to 0

Because we are presently behind a proxy server, there is a need to stop the boinc server searching the combined statistics site each time you enter your home page. To do this, edit the project's user.inc file (PROJECTHOME/html/inc/user.inc).

Find the php function get_other_projects (around line 60) and move the return line to be the first line of the function, so that it immediately returns on entry to the function.

Start User Operation

Connect a client to your project: http://<yourserver>.aims.ac.za/<yourproject>

By repeating the steps you took yesterday to connect to a project.

Or do it the sysadmin way:

Create an account.
accountkey: [your account key]

on a user account on the server:
upload boinc_5.8.16_i686-pc-linux-gnu.sh
chmod 700 boinc_5.8.16_i686-pc-linux-gnu.sh
./boinc_5.8.16_i686-pc-linux-gnu.sh

cd BOINC
./boinc 1>>stdout.out 2>>stderr.out &

boinc_cmd --project_attach http://<yourserver>.aims.ac.za/<yourproject> [your account key]