Install a real boinc server on ubuntu (breezy badger)
This howto will try to explain step by step how to install a boinc server on ubuntu.
Okay, now let's start.
Theorically everything is fine, there remains one thing: remove access to ops for not authenticated users: We will do it with htaccess:
This step will explain some hints to modify the look of the server and some other useless things:
Now, we will set the forum and the message boards.
Now, we will add a new application on the server. go into $project directory:
Install Ubuntu
- Get the ubuntu distribution and tip a CD, you can get the CD on http://www.ubuntu.com/download/. When the installation runs, write server (it will install only the minimum for the installation).
- When you start Ubuntu you have some editors: nano pico, ... If you want to use a new one:
sudo apt-get install emacs21
- Now we set where the server will download packages, With your editor, edit the file /etc/apt/sources.list. You have to be logged as root to edit this file. In the file, comment the first line (with a #) and uncomment the lines where it defines the universe repository. Some hints are written on the file. It should be easy to modify.
- Install ssh. We can the access from an other computer to the system.
sudo apt-get install ssh
- Now you have a small server that can be accessed from another computer.
Installing necessary stuff
In this step, we will install everything that can be used by boinc.- First we have to install gcc,g++, automake, autoconf,... These files will be used to compile boinc:
sudo apt-get install gcc g++ automake1.9 autoconf make
- Now, we install an apache server with mysql, with php and phpmyadmin, and openssl:
sudo apt-get install phpmyadmin apache2 mysql-server
libmysqlclient12-dev python-mysqldb php4-gd
libapache2-mod-auth-mysql libssl-dev - Modify the password of the mysql database. You can do it with phpmyadmin: go on $ip-adress/phpmyadmin and write as login root and without password. Then modify the password.
- Go on /etc/apache2/apache2.conf and add the line:
It will avoid getting all the time a signature verification error.DefaultType application/octet-stream
Modify /etc/group in sort that apache2 runs as boincadm (or like as you want...). Replace
withwww-data:x:33:
www-data:x:33:$admin
- Add these two lines to the beginning of the apache start script (called apachectl, usually in /usr/sbin on linux):
umask 2
export umask - restart apache2:
/etc/init.d/apache2 restart - We remove the database and put it into an other file, edit the file /etc/mysql/my.cnf and replace the line:
datadir = /var/lib/mysql
withdatadir = mynewdir
- Install CVS:
sudo apt-get install cvs
You will certainly get an error when you want to add an avatar on the server: unknown function image antialias. Comment the line where it appears and it should be ok.
Be sure that the user "mysql" has all access to this directory. Move the databases (they are in /var/lib/mysql):
sudo mv /var/lib/mysql/mydatabase mynewdir/
You have to restart mysql:
/etc/init.d/mysqld restart
Install Boinc
Okay, now let's start.
- checkout the boinc server:
cvs -d :pserver:anonymous:@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout -r stable boinc
The boinc files will be installed in the boinc directory, you can put this directory where you want, let us just call this directory $boinc. - Go into the $boinc directory, and start _autosetup:
./_autosetup
- Check that everything is okay and that we are going to install the server only:
Everything should be okay, if you have some errors, you certainly forgot to install one element../configure --disable-client
- Compile it:
make
- Install boinc:
sudo make install
Create a project
- First, we create keys... Go into a directory named keys and run:
It creates two 1024 bits keyscrypt_prog -genkey 1024 code_sign_private code_sign_public
crypt_prog -genkey 1024 upload_private upload_public - Then we create the project:
tools/make_project
--project_root <path>
--db_user <database_user>
--db_passwd <database_password>
--key_dir <key_directory>
--url_base <url_base>
<short_name> <long_name>
From now on the <path> will be called $project. It is within that are all the important files and <short_name> is now $project_name. - We have to configure apache2 in sort that it displays the website: copy the file $project/$project_name.httpd.conf in /etc/apaches/sites-available. symlink (the ln command)it in sites-enabled and restart apache:
/etc/init.d/apache2 restart
Set the security
Theorically everything is fine, there remains one thing: remove access to ops for not authenticated users: We will do it with htaccess:
- Create the directory $project usernames
- Change the rights on it:
chmod 711 usernames - Go in the directory and create a new user that will have access to the ops web page:
htpasswd -c .htpasswd <your_name>
It will create a file .htpasswd. You can remove entry within, or add new ones with
htpasswd .htpasswd <your_name>
without the "-c"
In the same directory, create a file named ".htaccess". Deny access from the web: create a new file and write within:
AuthGroupFile /dev/null
AuthName "DO NOT think to access this file"
AuthType Basic
deny from all- Go in $project/html/ops and create a file .htaccess, We will give access only to people who are in the .htpasswd:
- Now you are able to go to the main page without password. But if you want to go into the ops page, you have to give a password
- You can now remove the protection in $project/html/ops/cancel_wu_action.php look of the string:
if (1) {
echo "
WARNING! Make sure the html/ops directory is password-protected,
then edit html/ops/cancel_wu_action.php by hand to remove this message.
";
exit();
}
Invert the condition. You are now able to cancel workunits - We will now deny access to most of the ports:
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -j DROP
In that case, only ssh,http and ssl are accessible from the outside and you can get some message from port 25.
AuthName "administration access"
AuthUserFile PATH_TO_.HTPASSWD
AuthGroupFile /dev/null
AuthType Basic
<limit GET POST>
require valid-user
</Limit>
Tuning your boinc server
This step will explain some hints to modify the look of the server and some other useless things:
- Go into the file $project/html/project/project.inc. This file contains the constants used in the server: the url, the project name, ... Modify it.
- you can see in the file that you can define the css file, the file is in $project/html/user/ . You should modify it to have the same colors as your site.
- You have to change rights to different directories: $project/html/user_profile/images has to be apache read/write accesible.
- The owner of $project/upload has to be apache
Setting the forum
Now, we will set the forum and the message boards.
- Simply edit the file $project/html/ops/create_forums.php, and then run it into your server.
- Install php-cli: It is the php command-line:
sudo apt-get install php-cli - Edit the file /etc/php/php-cli/php.ini and uncomment the lines:
;extension=mysql.so
;extensio=gd.so - You can add all the extensions you need...
- Edit $project/html/ops/update_profile_pages.php and $project/html/ops/update_uotd.php. In the first line: replace with the path to the php executable:
#!/usr/local/bin/php
becomes
#!/usr/bin/php
Now, create a small script:
#!/bin/sh
cd $project/html/ops;
./update_profile_pages.php
./update_uotd.php
Create a cron job: Create a file and write within:
5,10,15,20,25,30,35,40,45,50,55 * * * * $project/update.sh- You have to create some images in the directory $project/html/user/img/:head_20.png rate_negative.png unread_post.png and rate_positive.png
Try to run the script to be sure it is running: You should have some warning...
Create the project
Now, we will add a new application on the server. go into $project directory:
- Copy the file $boinc/tools/project.xml into $project/project.xml
- Modify the file, you add your application.
- inform the server that some elements have been modified:
bin/xadd - From now on, we will consider that $app is the application name, $version is the version number of your application and $platform the target platform.
- Create a directory $app in $project/apps. Then a directory called $project/apps/$app/$app_$version_$platform
- Put your executable and all the files in the new directory
- Sign every file:
crypt_prog -sign executable key > signature_file
the signature_file should have the same name as the executable with an extension .sig. - Do the same for every other files that have to be sent.
- Update Boinc:
bin/update_versions - From now on, it depends on the generator, validator, assimilator you decide to use.
10 Comments:
Hummm...
I just did sudo apt-get install boinc-manager and was done.
I'm now on thee Ubuntu team for Rosetta@home.
I really like this detailed description. Helped me a lot to get started.
angrykeyboarder, the instructions above are for installing a boinc server. boinc-manager is a gui front end to the boinc client software.
Thanks a lot sir,your description might help us to move forward with our work.
Thank you
Dear Breezy,
I can't edit the files........It said I don't have the permission.
This was an excellent piece of work for two years ago but now with Ubuntu 7.10 (Gutsy) it seems to be outdated.
I hope the author is willing to post an update soon.
Keep up the good work..!
(Posted 14 Dec 2007)
I have installed BOINC on Fedora 7.10. User BOINCADM, project name: cplan
(cd /home/boincadm/boinc/tools
./make_project --test_app cplan)
When i used firefox and typed: http://localhost/cplan/ in URL, it errors:
Forbidden
You don't have permission to access /cplan/ on this server.
Please tell me why???
Although i changed permission of this folder:
chmod 755 cplan
...............
Thank you so much!
Hello, I just set a boinc server, I wonder if you have simple program that cant use to test the server.
Thanks
María Mays
Hi I can also use yum with many software packages in line right?
yum install soft1 soft2 just to replace sudo in Fedora?
Wonderful designing layout of the blog, i totally impressed with that post so thanks for sharing this post.
Post a Comment
<< Home