Why do I get an “Internal Server Error” on RHEL or derivatives?

 

We experienced crashes of the Python 2.6 interpreter in the Red Hat Enterprise Linux (RHEL) 6 or derivative (CentOS/Scientific Linux) distributions, when opening a BSCW 5.0 dialog (e.g. when creating a new folder). In this case on the web interface an "Internal Server Error" is shown and the error logfile of the Apache web server contains entries like

[Mon Jul 09 17:14:25 2012] [error] [client 10.10.10.20] python: Objects/stringobject.c:4098:
str_subtype_new: Assertion `((((PyObject*)(tmp))->ob_type) == &PyString_Type)' failed.,
referer: http:///bscw/bscw.cgi/48?op=addfolder&id=48
[Mon Jul 09 17:14:25 2012] [error] [client 10.10.10.20] Premature end of script headers: bscw.cgi,
referer: http:///bscw/bscw.cgi/48

The problem outlined above has been fixed by Red Hat beginning with version 6.4. So it is advisable first to upgrade to version 6.4 (or higher).

If you still experience this kind of crashes, you may compile your own Python (2.7) interpreter, install it in /usr/local (to not interfere with the system Python 2.6 interpreter) and upgrade your BSCW server to Python 2.7.

RHEL Python 2.7 installation

  1. Install the following required (development) RPM packages including required dependencies
yum install gcc g++ make patch
yum install db4-devel
yum install sqlite-devel
yum install openssl-devel
yum install bzip2-devel
yum install readline-devel
yum install gdbm-devel
yum install tk-devel
  1. Download and extract the latest Python 2.7 source distribution
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tgz
md5sum Python-2.7.6.tgz
bcf93efa8eaf383c98ed3ce40b763497  Python-2.7.6.tgz
tar xf Python-2.7.6.tgz
  1. Run the "configure" script with the given options and compile the sources
cd Python-2.7.6
export LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib"
./configure \
     --prefix=/usr/local \
     --enable-shared \
     --enable-ipv6 \
     --with-signal-module \
     --with-threads \
     --with-pymalloc
make
  1. Install the Python 2.7 interpreter environment (without interfering with other Python distributions)
make altinstall