Overview of BOINC Server Installation

From AIMSWiki

Overview of BOINC Server

Table of contents


This has been made thanks to Jan and Chris.

There are 2 parts to installing a BOINC client on a computer from scratch:

1 Set up a Linux LAMP server and configure the applications including

* Apache
* mySQL
* PHP

2 Load the BOINC specific server components which involves the following steps

* Linux Installation from Ubuntu
* Going from a Linux LAMP Server to a BOINC Server
* Log onto the LINUX LAMP server
* Setting up User Administration - for BOINC
* Logging on to make changes
* Set up your mysql database
* Get the BOINC Source
* Finally, BOINC Server Installation

We then end by checking that your server is running.

You may find this useful as well: http://www.aims.ac.za/wiki/index.php/Overview_Guide

Linux Installation from Ubuntu


THIS NEEDS TO BE INSERTED


Going from a Linux LAMP Server to a BOINC Server

We made use of this wiki: http://www.aims.ac.za/wiki/index.php/Africa%40Home_BOINCServerInstall

1 Log onto the LINUX LAMP server

From this point onwards, the server must be connected to the internet.

Make sure you have installed the following packages:

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

One may not need the following 3 packages, but it can't hurt to load them

ant 
python-dev 
python-libxml2
If your project is not working, a missing package could be the reason.

This can be done by

aptitude search <NAME OF PACKAGE>

If you need to install them use:

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 ant python-dev python-libxml2

2 Setting up User Administration - for BOINC

There needs to be a BOINC user administrator. This user wil be responsible for all BOINC server related activities.

To set this user up one must

2.1 add the user to the system

sudo adduser boincadm

during which you will be asked things like your name. To complete this is optional, but advisable. 2.2 give the user administrative priviledges which can be done using

sudo adduser boincadm admin 

and

2.3 add the webserver application owner (whatever that is ;-) ) to the BOINC server administrator group which can be done using

sudo usermod -G boincadm -a www-data

3 Logging on to make changes

If you are not logged onto the server, you need to, whch can be done using

ssh boincadm@<THE NAME OF THE SERVER>

This will result in a change in the prompt. The prompt is the thing in windows which can be, for example C:/. It should now read

boincadm@<THE NAME OF THE SERVER>:~$

4 Set up your mysql database

The BOINC server stores everything related to the BOINC application in a database. The main BOINC database needs to be set up.

(the root password for mysql database):
mysqladmin -h localhost -u root password <THE PASSWORD YOU WILL USE FOR THIS - AND MUST REMEMBER> 

Each project needs it's own database as well - to store the input and output from the Science App - but you only do this when you set up the Sceince App.

NORMALLY you would set a password for BOINCadm, however, doing so at this stage will cause endless problems during project creation later on. For this reason we will set the password to blank for now. YOU MUST SET ONE LATER.

One must now give the correct permissions to the boincadm user in the mysql database which can be done by

sudo mysql -h localhost -u root -p

When you do this you will be asked for your password - but it is the password for the boincadm. This has to happen for every SUDO command - although Linux is clever and remembers the password for a few minutes - so if you are quick, you will not be prompted ;-)

The prompt will now change from boincadm@<THE NAME OF THE SERVER>:~$ to mysql> You must then do the following:

GRANT ALL ON *.* TO 'boincadm'@'localhost';

which should say Query OK, 0 rows affected (0.00 sec) Then do

SET PASSWORD FOR 'boincadm'@'localhost'=password();

which should say Query OK, 0 rows affected (0.00 sec) Then do

FLUSH PRIVILEGES;

which should say Query OK, 0 rows affected (0.00 sec)

If one did not want to have a blank password, one could set it using this command above

> SET PASSWORD FOR 'boincadm'@'localhost'=password('<THE PASSWORD YOU WANT TO USE>');

Now leave mySQL by typing

quit

and it will say Bye' Sweet.

5 Get the BOINC Source

One now needs to get the BOINC source code by using

sudo aptitude install subversion

You may be asked to confirm with a y during this process.

If you are not running behind a proxy server (ask your network administrator) you do not need to do the rest of step 5. For instance, on a stand alone laptop test BOINC setup, this may be the case.

Then run

svn --version

This should give some rubbish but will ensure that the subversion configuration files is created. It can now be edited using any editor, like

  • nano or
  • vim

To edit the file write

vim ~/.subversion/servers

You now need to change two lines in the [global] section so that they read:

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

When using vim as the editor, one saves a file by presing the Escape key and then typing

:w

and leaves VIM by typing Escape

:q

Now use subversion to fetch the source, compile and test it. Which can be done by using the repository on Berkeleys server. This is done using

svn co http://boinc.berkeley.edu/svn/trunk/boinc boinc_trunk

This may take some time as it is getting information from the Berkeley server - maybe as much as an hour. There will be about 2500 lines streaming, ending with

Checked out revision X

Automake diversion

There may be a problem with the version of automake that you have.  When we did this we had v1.4 and v1.9 of automake installed, and we had to uninstall automake and install the latest version.  
sudo aptitude search automake
gives a list of versions that were available of which some are installed.  We removed versions 1.4 and 1.9 using
sudo aptitude remove automake1.4
sudo aptitude remove automake1.9
It should say some stuff ending with Removing automake1.9 ...
Then we need to install automake which we do by typing
sudo aptitude install automake1.9

6 Finally, BOINC Server Installation

Then you need to run

cd ~/boinc_trunk
./_autosetup

You should get a bunch of lines where the 2nd-6th end with succeeded and a line number, and end with Done, now run ./configure

Running configure on it's own will build the client and the server, but we only want to build the server, so we tell configure not to build the client using

./configure --disable-client

which will do a whole bunch of things, including checking that your system is capable of building BOINC. A good sign is if it ends with:

--- Build Components: (server only)---

If you get anything else, you need to fix this. You may be able to get help from one of these forums

* http://boinc.berkeley.edu/dev/
* *******************
* *******************
* *******************

Then run

make

which will put a whold lot of random stuff on the screen, followed by

sudo make install

which will put a whold lot more random stuff on the screen

7 Checking that your server is running

BOINC runs heavily on the Apache webserver so you should now check that the webserver is running on your server. To do this, you should connect from a client using a webbrowser (eg Mozilla Firefox or Internet Explorer) and type in

http://<SERVER IP ADDRESS>

and the <SERVER IP ADDRESS> can be found using the

ifconfig

and the ip address is 4 numbers with a point inbetween. The one you want is in the section for eth0 and follows inet addr

If the result begins with something like this - you are in luck (sorry about the formatting - but this wiki does not enable me to replicate it...

Index of /
Icon  Name                    Last modified      Size  Description

BUT YOU also need to check that the PHP interpreter is working, which you do by creating a PHP test file and putting it in the root of the webserver.

The root of the webserver is

/var/www/

So you can go there using

cd /var/www/

and then make a file by typing

sudo vim phptest.php

This is a dummy file and anything can be put in. A nice touch would be a comment like

<?php
echo "Thank you to all those that have made BOINC possible!!!!";
phpinfo();
?>

By going back to the webbrowser, and going to

http://<SERVER IP ADDRESS>/phptest.php

you should be presented with a page, where the first line contains your comment

Thank you to all those that have made BOINC possible!!!!

Finally, to switch off your Linux server

sudo shutdown -h now

You have now made a virgin BOINC server. It has no projects (or affiliation to Richard Branson) and you now need to develop and then deploy the Science App to take advantage of the volunteer computing infrastructure!