October 16, 2003

boinc transfer

I'm hereby transfering boinc discussions to http://www.stanford.edu/~torque/boinc.

Posted by torque at 2:32 PM | Comments (2) | TrackBack

October 15, 2003

I'm not sure what happened...

...but it worked. I think the key was to give no password permission for MySQL for both local host and brainwave.stanford.edu. Of course, as you can imagine, that's not the best idea. We ended up creating a new account, untaring the tarball, ./configure, make, and test_uc.py worked just fine. I changed the no password permission to be specific for yah. But it's yucky.

Posted by torque at 9:21 PM | Comments (1) | TrackBack

What's the problem?

From /root/src/boinc/db/db_base.C

int DB_BASE::enumerate(char* clause) {
int x;
char query[MAX_QUERY_LEN];

if (!cursor.active) {
cursor.active = true;
sprintf(query, "select * from %s %s", table_name, clause);
x = mysql_query(db->mysql, query);
if (x) return mysql_errno(db->mysql);
cursor.rp = mysql_store_result(db->mysql);
if (!cursor.rp) return mysql_errno(db->mysql);
row = mysql_fetch_row(cursor.rp);
if (!row) {
cursor.active = false;
return 1;
} else {
return 0;
Ok, so when a row is NOT found it returns a 1, but if a row is found it returns a 0. Now, take a look at /root/src/boinc/sched/main.C
found = false;
while (!gproject.enumerate("")) {
found = true;
if (!found) {
log_messages.printf(SchedMessages::CRITICAL, "can't find project\n");
Is that right? While we find rows, gproject.enumerate("") returns 0. Yeah, it looks right... are we getting an error?

Posted by torque at 10:11 AM | Comments (2) | TrackBack

Accessing database from cgi

You might find that the cgi cannot access the database, it's because the default user is the current unix user, which is not what you think it is when a cgi is being run. (I'm not sure what it is). Temporarily I gave anyone on the computer access to writing and searching the database, that fixed the problem and got me past the database error.

Posted by torque at 9:49 AM | Comments (3) | TrackBack

October 14, 2003


Here's an update. Using the latest tarball (nightly update), I'm now able to configure, pass test/test_sanity.py, and run make. However, the test/test_uc.py is still not working properly. It _looks_ like it is running but hangs for what seems like forever (>1 hr) on RUNNING, 50 unsent, 0, 0, 50. I erasing everything and starting over, just to make sure I didn't have any broken pieces.

[root@brainwave test]# ./test_uc.py

-- Testing standard upper_case application

Posted by torque at 10:51 AM | Comments (0) | TrackBack

October 13, 2003

Installing boinc

Here we go, here we go!

  1. Download the latest boinc tarball
  2. Though technically not needed, I upgraded automake from 1.6.x to 1.7.8 via rpm

  1. Now, gingerly follow the directions from Berkeley... I ran
    got a whole bunch of positive looking messages, and then
    Traceback (most recent call last): File "test/test_sanity.py", line 5, in ? from testbase import * File "test/testbase.py", line 16, in ? from Boinc.setup_project import * File "/root/src/boinc-2.04/py/Boinc/setup_project.py", line 9, in ? from Boinc import database, db_mid, configxml, tools File "/root/src/boinc-2.04/py/Boinc/database.py", line 38, in ? import MySQLdb, MySQLdb.cursors ImportError: No module named MySQLdb
    Yikes, that's no good. RPM check shows that I have installed MySQL-python.
  2. Turned out the rpm was bad, so uninstall the MySQL-python rpm, download the source code, and
    $ tar xfz MySQL-python-0.9.2.tar.gz $ cd MySQL-python-0.9.2 $ python setup.py build $ su # python setup.py install
  3. No, still problems
    Traceback (most recent call last): File "test/test_sanity.py", line 5, in ? from testbase import * File "test/testbase.py", line 18, in ? import cgiserver ImportError: No module named cgiserver
  4. It turned out that the latest version I had (2.04) was missing cgiserver.py - I ended up, with some advise from Karl Chen, downloading the latest nightly tarball. That fixed the the problem, and allowed me to pass test/test_sanity.py.
  5. Type make, and, if your setup is like mine, it'll complain about not finding gl.h. You need to add the developer XFree86 rpm, which requires fontconfig-devel, which requires freetype-devel - these can be found (at least for RH9) here- don't bother getting the latest version, there are too many dependencies. Here's what I used
    freetype-devel-2.1.3-6.i386.rpm fontconfig-devel-2.1-9.i386.rpm XFree86-devel-4.3.0-2.i386.rpm
    It should compile at this point.
  6. Haha, it'll compile, but 1/2 tests will fail. (Try 'make check'.)
    -- Testing standard upper_case application
    Posted by torque at 1:46 PM | Comments (6) | TrackBack

Installing PHP by Tarball

Here we go!

  1. Snag the latest tar from php.net.
  2. Run configure, I used
    ./configure --prefix=/usr/local/php-4.3.2 --with-mysql=/usr --with-apxs2=/usr/local/apache2/bin/apxs --with-openssl=/usr/local/openssl-0.9.7b --enable-magic-quotes --enable-sockets --with-curl
  3. Run 'make' and 'make install'
  4. Run
    libtool --finish /root/src/php-4.3.3/libs
    (Why didn't I run libtool before?)
  5. Add
    AddType application/x-httpd-php .php
    to /usr/local/apache2/conf/httpd.conf, and while you are at it, make 'index.php' the default index
    DirectoryIndex index.php index.html index.html.var
    (look for 'DirectoryIndex' using your editor)

Wait... I just found these instructions... maybe I should have found them earlier!

Posted by torque at 1:05 PM | Comments (3) | TrackBack

Installing httpd by tarball

Here we go.

  1. Remember earlier that we installed openssl-0.9.7c. This is resident in addition to the openssl-0.9.7a installed with SUlinux 9. We need to add /usr/local/openssl-9.7.c/lib to ld.so.conf. Then, remember to run ldconfig. (I forgot).
  2. You need to configure the makefile using ./configure:
    ./configure --prefix=/usr/local/apache2 --enable-modules=all --enable-mods-shared=all --with-ssl=/usr/local/openssl-0.9.7c --enable-ssl=shared
  3. Now do 'make' and it should work. It did for me.
  4. Now type 'make install'.
  5. Add the line
    /usr/local/apache2/bin/apachectl startssl
    to /etc/rc.d/rc.local.
  6. If you don't want to reboot now, but want to check that it worked, type
    /usr/local/apache2/bin/apachectl start

Posted by torque at 12:30 PM | Comments (2) | TrackBack


I downloaded and tried to install a bunch of RPM's... but still in the end, nothing seemed to work right. Here's what I grabbed:

[root@brainwave rpm]# ls
apr-0.9.4-2.i386.rpm MySQL-python-0.9.2-1.i386.rpm
apr-util-0.9.4-2.i386.rpm MySQL-server-4.0.15-0.i386.rpm
db4-4.1.25-10.i386.rpm MySQL-shared-compat-4.0.15-0.i386.rpm
httpd-2.0.47-8.i386.rpm php-4.3.3-2.i386.rpm
httpd-2.0.47-8.src.rpm php-imap-4.3.3-2.i386.rpm
mod_perl-1.99_07-5.i386.rpm php-ldap-4.3.3-2.i386.rpm
mod_python-3.0.3-3.i386.rpm pspell-0.12.2-16.i386.rpm
mod_ssl-2.8.15-1.i386.rpm redhat-config-httpd-1.1.0-3.noarch.rpm
MySQL-client-4.0.15-0.i386.rpm webalizer-2.01_10-14.i386.rpm
I was able to install the MySQL rpm's as well as MySQL-python (I had to upgrade db4 to version 4.1). This is the core of boinc. However, I had a lot of problems installing httpd. After updating apr and apr-util, I installed httpd and got this error when I tried to check the version:
[root@brainwave rpm]# rpm -i httpd-2.0.47-8.i386.rpm
warning: httpd-2.0.47-8.i386.rpm: V3 DSA signature: NOKEY, key ID 897da07a
[root@brainwave rpm]# httpd -v
httpd: relocation error: /usr/lib/libapr-0.so.0: symbol sys_siglist, version GLIBC_2.3.3 not defined in file libc.so.6 with link time reference
I was never able really to figure out what was wrong. So now, I'm resorting to installing from the tarball, which, I guess is ok since now I can compile in the newer version of openSSL. But now I'm worried I won't be able to rpm mod_perl, mod_python, mod_ssl, etc. That's a pain.

Posted by torque at 11:15 AM | Comments (2) | TrackBack

October 10, 2003

Updating PHP

Since we now have a new version of MySQL (where before we didn't!), we need to recompile PHP. But if this is the case we might as well upgrade to the latest version. For security's sake we will also upgrade openSSL, which in turn means we should upgrade Apache. (See how Linux becomes a problem?)

  1. First, lets update openSSL. Get the files.
    wget http://www.openssl.org/source/openssl-0.9.7c.tar.gz
    Unzip and untar using
    gunzip openssl-0.9.7c.tar.gz tar xvf openssl-0.9.7c.tar
    Configure it to run in /usr/local/openssl-0.9.7c by running
    ./Configure threads shared --prefix=/usr/local/openssl-0.9.7c --openssldir=/usr/local/openssl-0.9.7c linux-elf
    and then
    make make install
  2. Next, we will upgrade Apache. We first remove it from the distribution (scary!) using rpm -e
    [root@brainwave rpm]# rpm -e httpd error: Failed dependencies: httpd-mmn = 20020628 is needed by (installed) mod_perl-1.99_07-5 httpd-mmn = 20020628 is needed by (installed) mod_python-3.0.1-3 httpd-mmn = 20020628 is needed by (installed) mod_ssl-2.0.40-21.5 httpd-mmn = 20020628 is needed by (installed) php-4.2.2-17.2 libapr.so.0 is needed by (installed) mod_perl-1.99_07-5 libaprutil.so.0 is needed by (installed) mod_perl-1.99_07-5 webserver is needed by (installed) webalizer-2.01_10-11 httpd >= 2.0.40 is needed by (installed) mod_perl-1.99_07-5 httpd >= 2.0.40 is needed by (installed) mod_python-3.0.1-3 httpd is needed by (installed) redhat-config-httpd-1.0.1-18 httpd is needed by (installed) mod_ssl-2.0.40-21.5
    Oops, err maybe we don't.
Posted by torque at 3:49 PM | Comments (2) | TrackBack

Installing MySQL

This is BOINC continued. We need to install MySQL, recompile PHP, etc. But first things first. Previously I was unable to install MySQLdb for Python.

  1. We grab the rpm's for MySQL 4.0.15. We'll need the server, client, and the dynamic client libraries (including 3.23.x libraries). Since we'll have to compile PHP again, we'll also need the developer stuff. My box does not even have a browser, so I used 'wget' to get the files from one of the mirrors in Santa Clara.
    wget http://mysql.zawodny.com//Downloads/MySQL-4.0/MySQL-server-4.0.15-0.i386.rpm
    wget http://mysql.zawodny.com//Downloads/MySQL-4.0/MySQL-client-4.0.15-0.i386.rpm
    wget http://mysql.zawodny.com//Downloads/MySQL-4.0/MySQL-shared-compat-4.0.15-0.i386.rpm
    wget http://mysql.zawodny.com//Downloads/MySQL-4.0/MySQL-devel-4.0.15-0.i386.rpm
  2. Now we can install the packages (in the same order) using 'rpm -i', e.g.,
    rpm -i MySQL-server-4.0.15-0.i386.rpm
  3. When you are done with the packages, you should be able to set the MySQL root password using
    /usr/bin/mysqladmin -u root password 'new-password'
    /usr/bin/mysqladmin -u root -h brainwave.stanford.edu password 'new-password'
  4. Setup the symlink for mysql.sock
    ln -s /var/lib/mysql/mysql.sock /tmp
  5. Now you can install python MySQLdb using
    rpm -i MySQL-python-0.9.2-1.i386.rpm

Posted by torque at 2:44 PM | Comments (0) | TrackBack

Getting to BOINC

I've recently become interested in the Berkeley Open Infrastructure for Network Computing (BOINC) as an alternative to dedicated computing, e.g., Beowulf. In order to set it up though, we needed a Linux server. Here's what I did:

  1. Installed SUlinux 9
  2. Check installed software against BOINC software prerequisites
    [root@brainwave root]# gcc -v
    Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
    Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
    Thread model: posix
    gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

    [root@brainwave root]# mysql -V
    mysql Ver 12.21 Distrib 4.0.14, for intel-linux (i686)

    [root@brainwave root]# httpd -v
    Server version: Apache/2.0.40
    Server built: Jul 31 2003 11:36:14

    [root@brainwave root]# php -v

    [root@brainwave root]# python -V
    Python 2.2.2

  3. Download the python module MySQLdb 0.9.2
    [root@brainwave rpm]# wget http://easynews.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-0.9.2-1.i386.rpm
    --10:30:57-- http://easynews.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-0.9.2-1.i386.rpm
    => `MySQL-python-0.9.2-1.i386.rpm'
    Resolving easynews.dl.sourceforge.net... done.
    Connecting to easynews.dl.sourceforge.net[]:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 100,087 [application/x-rpm]

    100%[====================================>] 100,087 247.45K/s ETA 00:00

    10:30:57 (247.45 KB/s) - `MySQL-python-0.9.2-1.i386.rpm' saved [100087/100087]

Ahh, hey, that was all wrong. I had all these files because of AFS. /usr/pubsw actually belongs to Stanford, which is why I had problems. In fact, I need to reinstall quite a lot of things. I was able to remove the AFS pubsw files using

apt-get remove sulinux-afsconfig
Now, as expected, I do not have MySQL at all. Interestingly, it still looks for mysql at /usr/pubsw/bin/mysql. Maybe if I reboot? Yup, that did the trick. Now what I need to do is install MySQL, recompile PHP, etc.

You do not need to remove the afsconfig... so if you did, put it back in order by doing

apt-get install sulinux-afsconfig

Posted by torque at 11:04 AM | Comments (0) | TrackBack