Cheshire3 Installation |
The following instructions will hopefully walk you through installing Cheshire3 and its prerequisites from scratch under Linux (or any Unix). If you have troubles at any stage, feel free to contact us.
Alternatively, there is a shell script that will compile everything as per the instructions below. Retrieve ftp://ftp.cheshire3.org/pub/cheshire3/cheshire3-0.8-FULL.tgz (100M), uncompress it, and run build.sh.
All of the code used is available together at: ftp://ftp.cheshire3.org/pub/cheshire3/
The links below are for if you want to check if there's a more recent version than the one we have available.
Below is a set of instructions to install all of the requirements in user space, rather than globally. If you want to install globally omit the --prefix from the configurations. The example location is '/home/cheshire/install' and the source is being decompressed in /home/cheshire/build
Before embarking on the process below, you'll need to have a C compiler and make utility installed along with the appropriate libraries. We strongly recommend GCC. But you probably already do.
If you don't install everything in one session, you'll need to ensure that the environment variables are reset:
export CPPFLAGS=-I/home/cheshire/install/include
export LDFLAGS=-L/home/cheshire/install/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/cheshire/install/lib
./configure --prefix=/home/cheshire/install
make
make install
Python 2.4+ and 4Suite 1.0a4+ both include expat version 1.95.8. Previously the included versions were different and this could cause problems running under Apache. The 'minimum' versions have now been updated to these, but if you want to hack in the same version of expat to Python/4Suite or not run under Apache, then previous versions will be okay. You do not need to install this package if it is already present on your system. Most *nix distributions include Expat.
cd build_unix
../dist/configure --prefix=/home/cheshire/install
make
make install
BerkeleyDB is generally present in most Linux systems. If there is a version 4 or greater, then this is unnecessary.
export CPPFLAGS=-I/home/cheshire/install/include
export LDFLAGS=-L/home/cheshire/install/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/cheshire/install/lib
./configure --prefix=/home/cheshire/install --enable-mods=all
--with-berkeley-db=/home/cheshire/install --enable-suexec
make
make install
Apache is also generally present in most systems, however you must ensure that it is run with the right environment variable so that it will link against the libraries that have been installed. Also, you'll need to ensure that the user which Apache is run as has read (and potentially write) access to the databases which the index and record data is maintained in.
MacOSX note: use --enable-framework in the configure to build as a framework.
./configure --prefix=/home/cheshire/install
make
make install
./configure --prefix=/home/cheshire/install --with-python=/home/cheshire/install/bin/python2.4 --with-apxs=/home/cheshire/install/bin/apxs
make
make install
python ./setup.py build
python ./setup.py install
The most recent version of ZSI either requires PyXML to be installed (which is not otherwise required for Cheshire3, and can conflict with 4Suite which is a better package) or to use the CVS version. The CVS version is available in the Cheshire3 FTP site.
python ./setup.py build
python ./setup.py install
The PyStemmer library is not being maintained but a new version is available in TextIndexNG. However the new version sometimes does not compile properly on older platforms (eg Redhat 7.2) and the older version does not compile properly on newer platforms (Fedora Core 3). The stemmer library is the only thing used from TextIndexNG.
python ./setup.py install
Or for TextIndexNG:
python2.3 ./setup.py build
cd build/lib*
cp Stemmer.so /home/cheshire/install/lib/python2.4/site-packages/
You may need to install lex and yacc by hand first, as these are required to build the ASN.1 compiler.
cp lex.py yacc.py /home/cheshire/install/lib/python2.4/site-packages/
python ./setup.py install
python ./setup.py install
python ./setup.py install
./configure --prefix=/home/cheshire/install --with-python
make
make install
cd python
python ./setup.py install
./configure --prefix=/home/cheshire/install --with-python
make
make install
[Coming]
[Coming]
./configure --prefix=/home/cheshire/install
make
make install
export LD_LIBRARY_PATH=/home/cheshire/install/lib
export LD_RUN_PATH=/home/cheshire/install/lib
Also ensure that Apache is run with these environment variables (envvars / envvars-std files with httpd binary)
Include conf/cheshire3.conf
# Load mod_python
LoadModule python_module modules/mod_python.so
# SRW/U interface at /srw/dbname
<Directory /home/cheshire/install/htdocs/srw>
SetHandler mod_python
PythonDebug On
PythonPath "['/home/cheshire/cheshire3/code']+sys.path"
PythonHandler srwApacheHandler
</Directory>
# Z3950 interface on 2100
Listen 2100
<VirtualHost *:2100>
PythonPath "['/home/cheshire/cheshire3/code']+sys.path"
PythonConnectionHandler zApacheHandler
PythonDebug On
</VirtualHost>
If you get strange errors from mod_python under Linux, first trying restarting Apache.
If this fails with a No space left on device
error when there obviously
is space, then you've hit the semaphore problem.
The fix is:
echo "512 32000 32 512" > /proc/sys/kernel/sem
Or see:
http://clarens.sourceforge.net/index.php?docs+faq
If you have trouble compiling Apache 2.0.50 under Solaris, for example:
A (not very elegant) solution from Giulia Hill @ UC Berkeley is:In file included from apr_dbm_berkeleydb.c:24: /usr/include/stdlib.h:165: error: conflicting types for 'getsubopt' /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.0/include/stdio.h:281: error: previous declaration of 'getsubopt' was here