Installation of Pique

Granting davidf rights to manage software and services:

(root)$ visudo

and adding:


Preparing for source install:

(root)$ cd /localstore
(root)$ mkdir -p usr/local
(root)$ mv /usr/local/src usr/local
(root)$ cd /usr/local
(root)$ ln -s /localstore/usr/local/src .
(root)$ cd /usr/local/src/
(root)$ mkdir hisparc
(root)$ chown davidf.hisparc hisparc/
$ chmod g+w hisparc/

In /etc/ new file usrlocal.conf, to let ldconfig find libraries of locally installed software:




$ cd /usr/local/src/hisparc
$ wget
$ tar xvzf Python-2.6.4.tgz
$ cd Python-2.6.4
$ ./configure --enable-shared
$ make
(root)$ make install

Then, run:

(root)$ ldconfig

Now, the python libraries are registered.

Python Setuptools

From egg:

$ cd /usr/local/src/hisparc
$ wget
(root)$ sh setuptools-0.6c11-py2.6.egg

IPython, an interactive Python shell

Download and install IPython:

(root)$ easy_install ipython

Web server

Install apache development libraries:

$ sudo yum install httpd-devel

 Package             Arch        Version                 Repository        Size
 httpd-devel         i386        2.2.3-31.sl5.2          sl-security      147 k
 httpd-devel         x86_64      2.2.3-31.sl5.2          sl-security      147 k
Installing for dependencies:
 apr                 x86_64      1.2.7-11.el5_3.1        sl-security      118 k
 apr-devel           x86_64      1.2.7-11.el5_3.1        sl-security      237 k
 apr-util            x86_64      1.2.7-7.el5_3.2         sl-security       74 k
 apr-util-devel      x86_64      1.2.7-7.el5_3.2         sl-security       53 k
 httpd               x86_64      2.2.3-31.sl5.2          sl-security      1.2 M

Change configuration in /etc/httpd/conf/httpd.conf. Patch:

--- httpd.conf.orig     2009-12-04 14:35:39.000000000 +0100
+++ httpd.conf  2009-12-04 14:35:50.000000000 +0100
@@ -228,8 +228,8 @@
 #  when the value of (unsigned)Group is above 60000;
 #  don't use Group #-1 on these systems!
-User apache
-Group apache
+User www
+Group www

 ### Section 2: 'Main' server configuration

Enabling httpd on startup:

$ sudo /sbin/chkconfig --add httpd
$ sudo /sbin/chkconfig --levels 35 httpd on

Starting httpd now:

$ sudo /sbin/service httpd start

For mod_wsgi:

$ cd /usr/local/src/hisparc
$ wget
$ tar xvzf mod_wsgi-3.1.tar.gz
$ cd mod_wsgi-3.1
$ ./configure
$ make
(root)$ make install

Change configuration in /etc/httpd/conf/httpd.conf. Patch:

--- httpd.conf.orig     2009-12-04 15:19:01.000000000 +0100
+++ httpd.conf  2009-12-04 15:34:30.000000000 +0100
@@ -197,6 +197,7 @@
 LoadModule mem_cache_module modules/
 LoadModule cgi_module modules/
 LoadModule version_module modules/
+LoadModule wsgi_module modules/

 # The following modules are not loaded by default:

Restarting apache:

$ sudo /sbin/service httpd restart

Version control

Install bazaar from source:

$ cd /usr/local/src/hisparc
$ wget
$ tar xvzf bzr-2.0.2.tar.gz
$ cd bzr-2.0.2
(root)$ python install


Paramiko supports ssh2 for python, which is needed to do a checkout of our application’s sources over sftp. Install using easy_install:

(root)$ easy_install paramiko

This will automatically download, compile and install dependencies (pycrypto).

Public database web application

The public database blablabla. It is a pure python implementation under complete version control.


The public database application uses PyTables and the underlying HDF5 library to read binary data files. PyTables depends heavily on NumPy.:

(root)$ easy_install numpy

This gives an error:

/tmp/easy_install-JePGOA/numpy-1.4.0rc1/numpy/distutils/ RuntimeWarning: Parent module 'numpy.distutils' not found while handling absolute import
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/tmp/easy_install-JePGOA/numpy-1.4.0rc1/numpy/distutils/", line 248, in clean_up_temporary_directory
ImportError: No module named numpy.distutils
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/tmp/easy_install-JePGOA/numpy-1.4.0rc1/numpy/distutils/", line 248, in clean_up_temporary_directory
ImportError: No module named numpy.distutils

So, rerun the command, this time without errors:

(root)$ easy_install numpy


$ cd /usr/local/src/hisparc
$ wget
$ tar xvzf hdf5-1.8.3.tar.gz
$ cd hdf5-1.8.3
$ ./configure --prefix=/usr/local
$ make
(root)$ make install
(root)$ ldconfig

And, finally, install PyTables itself:

(root)$ easy_install tables

The public databases graphing capabilities come from Enthought Chaco, a python plotting library. It needs swig to build. Install with:

$ wget
$ tar xvzf swig-1.3.40.tar.gz
$ cd swig-1.3.40
$ ./configure
$ make
(root)$ make install

It also needs a GUI toolkit, like wxPython:

$ wget
$ tar xvjf wxPython-src-
$ cd wxPython-src-
$ ./configure --enable-unicode --with-opengl
$ make && make -C contrib/src/gizmos && make -C contrib/src/stc
(root)$ make install && make -C contrib/src/gizmos install && make -C contrib/src/stc install
$ cd wxPython/src/gtk
$ patch < /usr/local/src/hisparc/gdi.patch
$ cd ../..
(root)$ python install

The contents of the aforementioned gdi.patch is:

--- wxPython/src/gtk/_gdi_wrap.cpp.orig 2009-08-08 16:26:48.000000000 +0200
+++ wxPython/src/gtk/_gdi_wrap.cpp      2009-08-08 16:32:50.000000000 +0200
@@ -4195,6 +4195,10 @@
     virtual wxGraphicsBrush CreateRadialGradientBrush(wxDouble , wxDouble , wxDouble , wxDouble , wxDouble ,
                                                       const wxColour &, const wxColour &)  { return wxNullGraphicsBrush; }
     virtual wxGraphicsFont CreateFont( const wxFont & , const wxColour & ) { return wxNullGraphicsFont; }
+    // patch required as explained in
+    //
+    wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) const { return wxNullGraphicsBitmap; }

We currently run Chaco straight out of the subversion repository. Once a new release has been finalized, we might go back to simply install from PyPI. Now, however, we have to issue:

(root)$ easy_install etsprojecttools
$ ets co Chaco
(root)$ ets install Chaco_3.2.1

Setting up the public database

In summary:

Here we go:

$ cd /usr/local/src/hisparc
$ bzr co s publicdb
(root)$ cd /var/www
(root)$ mkdir django_publicdb
(root)$ chown davidf.hisparc django_publicdb/
$ ln -s /usr/local/src/hisparc/publicdb/django_publicdb/* .
$ cp --remove-destination /usr/local/src/hisparc/publicdb/django_publicdb/ .
$ cp --remove-destination /usr/local/src/hisparc/publicdb/django_publicdb/ .
$ cp /usr/local/src/hisparc/publicdb/examples/django.wsgi .

And edit django.wsgi so that it contains the right system path:


Then, added the public database to the Apache configuration:

(root)$ cd /etc/httpd/conf.d/
(root)$ touch hisparc.conf
(root)$ chown davidf.hisparc hisparc.conf
(root)$ chmod g+w hisparc.conf

And edit hisparc.conf to contain:

RedirectMatch ^/$

WSGIScriptAlias /django /var/www/django_publicdb/django.wsgi
WSGIPythonEggs /tmp

Alias /django/media /usr/local/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media

Reload Apache configuration:

$ sudo /sbin/service httpd reload



mkdir /var/www/media
chown www.www media
ln -s /var/www/django_publicdb/static media

cd /usr/local/bin
cp /usr/local/src/hisparc/publicdb/examples/ hisparc-update

# Run a daily check for new events, but it _must_ be a few hours after
# midnight, so don't place this script in cron.daily, just to be sure.
0 4 * * * root /usr/local/bin/hisparc-update

python PIL

django cron script on pique, changed a bit?