5 | | For experimentation and debugging, you can use almost any computer as a BOINC server. Before deploying a project more widely, make sure that your server has adequate performance, availability, and security. Some factors: |
6 | | |
7 | | * Your Internet connection should have adequate performance and reliability. Your server must have a static IP address. |
8 | | * Your server should have good CPU speed(dual Xeon or Opteron), at least 2 GB of RAM, and at least 40 GB of free disk space. For a high-traffic project, use a machine with 8 GB of RAM or more, and 64-bit processors. |
9 | | * Do whatever you can to make it highly reliable (UPS power supply, RAID disk configuration, hot-swappable spares, temperature-controlled machine room, etc.). |
10 | | * Put it behind a firewall; allow access via port 80 (HTTP) and optionally 443 (HTTPS). |
11 | | * Make it secure; turn off any unneeded network services, especially those that use plaintext passwords (like FTP or Telnet). |
| 5 | For experimentation and debugging, |
| 6 | you can use almost any computer as a BOINC server. |
| 7 | Before deploying a project more widely, |
| 8 | make sure that your server has adequate performance, availability, and security. |
| 9 | Some factors: |
| 10 | |
| 11 | * Your Internet connection should have adequate performance and reliability. |
| 12 | Your server must have a static IP address. |
| 13 | * Your server should have good CPU speed(dual Xeon or Opteron), |
| 14 | at least 2 GB of RAM, and at least 40 GB of free disk space. |
| 15 | For a high-traffic project, use a machine with 8 GB of RAM or more, |
| 16 | and 64-bit processors. |
| 17 | * Do whatever you can to make it highly reliable (UPS power supply, |
| 18 | RAID disk configuration, hot-swappable spares, |
| 19 | temperature-controlled machine room, etc.). |
| 20 | * Put it behind a firewall; allow access via port 80 (HTTP) |
| 21 | and optionally 443 (HTTPS). |
| 22 | * Make it secure; turn off any unneeded network services, |
| 23 | especially those that use plaintext passwords (like FTP or Telnet). |
20 | | * The easiest way to set up a BOINC server is to use a [wiki:VmServer BOINC server VM] that we've created for that purpose, with all the necessary software already installed. You can run this virtual machine using the [http://www.vmware.com/download/player/ VMWare player] on any Intel-based computer (Windows, Linux, or Mac OS X). If you take this approach, skip the rest of this page. |
21 | | |
22 | | * Debian and Ubuntu offer the boinc-server-maker package to create BOINC project more easily on local or remote machines. This ongoing effort, described on their [http://wiki.debian.org/BOINC/ServerGuide Wiki] aims at full compatibility with the BOINC Virtual Machine. If anyone is interested in helping maintaining a boinc-server package for Debian, please contact David Anderson. Again, if you take this approach, skip the rest of this page. |
23 | | |
24 | | * You can use any Unix system as a BOINC server; we recommend using a recent Linux release. Disable SELinux. General instructions are given below, followed by a [#cookbook-debian40 a cookbook for setting up a BOINC server on a Debian 4.0 system]. |
| 34 | * The easiest way to set up a BOINC server is to use a |
| 35 | [wiki:VmServer BOINC server VM] that we've created for that purpose, |
| 36 | with all the necessary software already installed. |
| 37 | You can run this virtual machine using the |
| 38 | [http://www.vmware.com/download/player/ VMWare player] |
| 39 | on any Intel-based computer (Windows, Linux, or Mac OS X). |
| 40 | If you take this approach, skip the rest of this page. |
| 41 | |
| 42 | * Debian and Ubuntu offer the boinc-server-maker package to create |
| 43 | BOINC project more easily on local or remote machines. |
| 44 | This ongoing effort, described on their |
| 45 | [http://wiki.debian.org/BOINC/ServerGuide Wiki] aims at full compatibility |
| 46 | with the BOINC Virtual Machine. |
| 47 | If anyone is interested in helping maintaining a boinc-server package |
| 48 | for Debian, please contact David Anderson. |
| 49 | Again, if you take this approach, skip the rest of this page. |
| 50 | |
| 51 | * You can use any Unix system as a BOINC server; |
| 52 | we recommend using a recent Linux release. |
| 53 | Disable SELinux. General instructions are given below, |
| 54 | followed by a [#cookbook-debian40 a cookbook for setting up |
| 55 | a BOINC server on a Debian 4.0 system]. |
30 | | * The scheduler and file upload handler are CGI programs, so they run as the same user as the web server (on Fedora this is user '`apache`'; on Debian it's '`www-data`'). |
31 | | * BOINC daemons run as whoever created the project (let's say user '`boincadm`', group '`boinc`'). '''Do not run BOINC daemons (or anything else) as root'''. |
32 | | |
33 | | By default, the directories created by user `apache` are not world-writable. This causes problems: for example, when the file upload handler creates a directory in the [wiki:DirHierarchy upload hierarchy], it's owned by (`apache`, `apache`), and the [wiki:FileDeleter file deleter] (which runs as `boincadm`) won't be able to delete the files there. |
34 | | |
35 | | To solve this problem, edit `/etc/group` so that `apache` belongs to group `boinc`, i.e. the line: |
| 61 | * The scheduler and file upload handler are CGI programs, |
| 62 | so they run as the same user as the web server |
| 63 | (on Fedora this is user '`apache`'; on Debian it's '`www-data`'). |
| 64 | * BOINC daemons run as whoever created the project |
| 65 | (let's say user '`boincadm`', group '`boinc`'). |
| 66 | '''Do not run BOINC daemons (or anything else) as root'''. |
| 67 | |
| 68 | By default, the directories created by user `apache` are not world-writable. |
| 69 | This causes problems: for example, when the file upload handler creates |
| 70 | a directory in the [wiki:DirHierarchy upload hierarchy], |
| 71 | it's owned by (`apache`, `apache`), and the [wiki:FileDeleter file deleter] |
| 72 | (which runs as `boincadm`) won't be able to delete the files there. |
| 73 | |
| 74 | To solve this problem, edit `/etc/group` so that `apache` belongs |
| 75 | to group `boinc`, i.e. the line: |
47 | | Both `boincadm` and `apache` should have [http://www.slackwiki.org/Permissions_and_Umasks umasks] that allow group read and write. |
48 | | |
49 | | {{{ |
50 | | #!comment That umask thing needs to be clarified; I had to go see an old version of GroupPermissions to see how umasks were set. Umasks are "inverted", that makes them hard to understand (they mark permissions to UNset). |
51 | | }}} |
52 | | When you create a BOINC project using [wiki:MakeProject make_project], the critical directories are owned by `boincadm` and have the set-GID bit set; this means that any directories or files created by `apache` in those directories will have group `boinc` (not group `apache`). The BOINC software makes all directories group read/write. Thus, both `apache` and `boinc` will have read/write access to all directories and files, but other users will have no access. |
| 87 | Both `boincadm` and `apache` should have |
| 88 | [http://www.slackwiki.org/Permissions_and_Umasks umasks] |
| 89 | that allow group read and write. |
| 90 | |
| 91 | {{{ |
| 92 | #!comment That umask thing needs to be clarified; |
| 93 | I had to go see an old version of GroupPermissions to see how umasks were set. |
| 94 | Umasks are "inverted", that makes them hard to understand |
| 95 | (they mark permissions to UNset). |
| 96 | }}} |
| 97 | When you create a BOINC project using [wiki:MakeProject make_project], |
| 98 | the critical directories are owned by `boincadm` and have the set-GID bit set; |
| 99 | this means that any directories or files created by `apache` |
| 100 | in those directories will have group `boinc` (not group `apache`). |
| 101 | The BOINC software makes all directories group read/write. |
| 102 | Thus, both `apache` and `boinc` will have read/write access |
| 103 | to all directories and files, but other users will have no access. |
64 | | You may also need to change the ownership of these directories and all their subdirectories to `boincadm/boinc`. If you're running several projects on the same server and want to isolate them from each other, you can create a different user and group for each project, and add `apache` to all of the groups. |
65 | | |
66 | | When serving your project files from Apache, note that all directories up to and including the `html` directory must have execute permissions. For example, if you use `make_project` to create the project template in your home directory, your home directory must have 711 permissions as opposed to the default of 700. If this is not corrected, you will receive a '''403 Forbidden''' error when attempted to browse to your project page. See [http://httpd.apache.org/docs/1.3/misc/FAQ.html#forbidden more information on dealing with Apache permissions problems]. |
| 115 | You may also need to change the ownership of these directories |
| 116 | and all their subdirectories to `boincadm/boinc`. |
| 117 | If you're running several projects on the same server |
| 118 | and want to isolate them from each other, |
| 119 | you can create a different user and group for each project, |
| 120 | and add `apache` to all of the groups. |
| 121 | |
| 122 | When serving your project files from Apache, |
| 123 | note that all directories up to and including the `html` directory |
| 124 | must have execute permissions. |
| 125 | For example, if you use `make_project` to create the project template |
| 126 | in your home directory, |
| 127 | your home directory must have 711 permissions |
| 128 | as opposed to the default of 700. |
| 129 | If this is not corrected, you will receive a '''403 Forbidden''' error |
| 130 | when attempted to browse to your project page. |
| 131 | See [http://httpd.apache.org/docs/1.3/misc/FAQ.html#forbidden |
| 132 | more information on dealing with Apache permissions problems]. |
74 | | Some parts of the BOINC server (the feeder and scheduling server) use shared memory. Hosts where these run must have shared memory enabled, with a maximum segment size of at least 32 MB. How to do this depends on the operating system; read [http://developer.postgresql.org/docs/postgres/kernel-resources.html Managing Kernel Resources on PostgreSQL manual] for more information. |
| 141 | Some parts of the BOINC server (the feeder and scheduling server) |
| 142 | use shared memory. |
| 143 | Hosts where these run must have shared memory enabled, |
| 144 | with a maximum segment size of at least 32 MB. |
| 145 | How to do this depends on the operating system; |
| 146 | read [http://developer.postgresql.org/docs/postgres/kernel-resources.html |
| 147 | Managing Kernel Resources on PostgreSQL manual] for more information. |
77 | | * After installing and running the server, grant permissions for your own account and for the account under which Apache runs ('nobody' in the following; may be different on your machine). All MySQL accounts should be password protected, especially `root`. |
| 150 | * After installing and running the server, |
| 151 | grant permissions for your own account and for the account under |
| 152 | which Apache runs ('nobody' in the following; |
| 153 | may be different on your machine). |
| 154 | All MySQL accounts should be password protected, especially `root`. |
85 | | * Set your `PATH` environment variable to include MySQL programs (typically `/usr/local/mysql` and `/usr/local/mysql/bin`). |
86 | | * You'll need to back up your database. Generally this requires stopping the project, making a copy or snapshot, and restarting. An example is [//mysql_backup.txt here]. |
87 | | * BOINC gets MySQL compiler and linker flags from a program called `mysql_config` which comes with your MySQL distribution. This sometimes references libraries that are not part of your base system installation, such as `-lnsl` or `-lnss_files`. You may need to install additional packages (often you can use something called 'mysql-dev' or 'mysql-devel') or fiddle with Makefiles. |
88 | | * MySQL can be the bottleneck in a BOINC server. To optimize its performance, read about [wiki:MysqlConfig configuring MySQL for BOINC]. |
| 162 | * Set your `PATH` environment variable to include MySQL programs |
| 163 | (typically `/usr/local/mysql` and `/usr/local/mysql/bin`). |
| 164 | * You'll need to back up your database. |
| 165 | Generally this requires stopping the project, |
| 166 | making a copy or snapshot, and restarting. |
| 167 | An example is [//mysql_backup.txt here]. |
| 168 | * BOINC gets MySQL compiler and linker flags from a program called |
| 169 | `mysql_config` which comes with your MySQL distribution. |
| 170 | This sometimes references libraries that are not part of your base system |
| 171 | installation, such as `-lnsl` or `-lnss_files`. |
| 172 | You may need to install additional packages |
| 173 | (often you can use something called 'mysql-dev' or 'mysql-devel') |
| 174 | or fiddle with Makefiles. |
| 175 | * MySQL can be the bottleneck in a BOINC server. |
| 176 | To optimize its performance, |
| 177 | read about [wiki:MysqlConfig configuring MySQL for BOINC]. |
101 | | To limit denial-of-service attacks, we recommend turning off directory indexing by adding `-Indexes` to the [http://httpd.apache.org/docs/2.0/mod/core.html#options Options] directive. |
102 | | |
103 | | Make sure that the filename extensions used by your application or data files aren't handled in undesired way by Apache. For example, if some of your files have a '.map' extension, remove the line |
| 191 | To limit denial-of-service attacks, we recommend turning off directory |
| 192 | indexing by adding `-Indexes` to the |
| 193 | [http://httpd.apache.org/docs/2.0/mod/core.html#options Options] directive. |
| 194 | |
| 195 | Make sure that the filename extensions used by your application or data files |
| 196 | aren't handled in undesired way by Apache. |
| 197 | For example, if some of your files have a '.map' extension, remove the line |
117 | | * By default, BOINC uses PHP's `mail` function to send email to participants. This uses sendmail. If this doesn't work, you can use [http://phpmailer.sourceforge.net/ PHPMailer] instead, which is a very flexible mail-sending mechanism. To do this: |
118 | | * Download PHPMailer and put it under PROJECT/html/inc/phpmailer (i.e. the files class.smtp.php and class.phpmailer.php should be in that directory). |
119 | | * Set the following variables in your PROJECT/html/project/project.inc file (substitute your own values): |
| 214 | * By default, BOINC uses PHP's `mail` function to send email to participants. |
| 215 | This uses sendmail. |
| 216 | If this doesn't work, you can use |
| 217 | [http://phpmailer.sourceforge.net/ PHPMailer] instead, |
| 218 | which is a very flexible mail-sending mechanism. To do this: |
| 219 | * Download PHPMailer and put it under PROJECT/html/inc/phpmailer |
| 220 | (i.e. the files class.smtp.php and class.phpmailer.php should be |
| 221 | in that directory). |
| 222 | * Set the following variables in your PROJECT/html/project/project.inc file |
| 223 | (substitute your own values): |
133 | | The link /usr/bin/gcc that points to the currently used compiler could be missing. This could lead to errors when running the make command. Especially when trying to compile the graphical part of the API you need the /usr/bin/g++ link (make gives a warning that it couldn't find GL/GLU/GLUT although it is installed). So you have to create the symbolic links, depending on your gcc and g++ version, first. |
| 238 | The link /usr/bin/gcc that points to the currently used compiler |
| 239 | could be missing. |
| 240 | This could lead to errors when running the make command. |
| 241 | Especially when trying to compile the graphical part of the API |
| 242 | you need the /usr/bin/g++ link |
| 243 | (make gives a warning that it couldn't find GL/GLU/GLUT |
| 244 | although it is installed). |
| 245 | So you have to create the symbolic links, |
| 246 | depending on your gcc and g++ version, first. |
139 | | At newer linux distributions you can’t login as user root. Instead there is a user notroot with whom you can login, but you won’t have root privileges. If an application or script needs root privileges, you are forced to enter the password you entered during the installation. In the console window you can get root privileges with the su (Debian) or sudo (Ubuntu, Fedora) command also. Note the single quotes around the command when using su -c ! |
| 252 | At newer linux distributions you can’t login as user root. |
| 253 | Instead there is a user notroot with whom you can login, |
| 254 | but you won’t have root privileges. |
| 255 | If an application or script needs root privileges, |
| 256 | you are forced to enter the password you entered during the installation. |
| 257 | In the console window you can get root privileges with the |
| 258 | su (Debian) or sudo (Ubuntu, Fedora) command also. |
| 259 | Note the single quotes around the command when using su -c ! |
157 | | Please follow these recipes only for your basic orientation. The Debian landscape has changed a lot over since Debian 4.0. You can inspect the build and runtime dependencies of the boinc-server-maker package [http://anonscm.debian.org/gitweb/?p=pkg-boinc/boinc.git;a=blob_plain;f=debian/control;hb=HEAD here] and the latter more graphically also [http://packages.debian.org/unstable/net/boinc-server-maker here]. |
| 280 | Please follow these recipes only for your basic orientation. |
| 281 | The Debian landscape has changed a lot over since Debian 4.0. |
| 282 | You can inspect the build and runtime dependencies of the |
| 283 | boinc-server-maker package |
| 284 | [http://anonscm.debian.org/gitweb/?p=pkg-boinc/boinc.git;a=blob_plain;f=debian/control;hb=HEAD here] |
| 285 | and the latter more graphically also |
| 286 | [http://packages.debian.org/unstable/net/boinc-server-maker here]. |
219 | | This list contains all necessary packages for the BOINC server and the client components. At first startup, these packages should be installed with aptitude. The graphical desktop manager is optional, but makes the configuration of the server a bit easier. The list contains no security packages to secure your server! Please ask your system administrator or read a good Linux book on how to secure your server against attacks. |
| 349 | This list contains all necessary packages for the BOINC server and the client |
| 350 | components. |
| 351 | At first startup, these packages should be installed with aptitude. |
| 352 | The graphical desktop manager is optional, |
| 353 | but makes the configuration of the server a bit easier. |
| 354 | The list contains no security packages to secure your server! |
| 355 | Please ask your system administrator or read a good Linux book |
| 356 | on how to secure your server against attacks. |
228 | | Go to ‘K-Menu’ -> ‘Settings’ -> ‘System Administration’ -> ‘User Management’, claim administrative privileges |
229 | | |
230 | | Create a new user, for example: boincadm |
231 | | |
232 | | After that go to the ‘Groups’ tab and add the user ‘www-data’ to the group ‘boincadm’. |
| 365 | * Go to ‘K-Menu’ -> ‘Settings’ -> ‘System Administration’ -> ‘User Management’, |
| 366 | claim administrative privileges |
| 367 | |
| 368 | * Create a new user, for example: boincadm |
| 369 | |
| 370 | * After that go to the ‘Groups’ tab and add the user ‘www-data’ |
| 371 | to the group ‘boincadm’. |
278 | | Hint: Normally you won't need a self-compiled client, you can always get the latest one from [//download_all.php BOINC website]. |
279 | | |
280 | | NOTE: Tags are only for client software, always checkout the latest revision for the server! |
| 419 | Hint: Normally you won't need a self-compiled client, |
| 420 | you can always get the latest one from [//download_all.php BOINC website]. |
| 421 | |
| 422 | NOTE: Tags are only for client software, |
| 423 | always checkout the latest revision for the server! |