Installation on Windows NT/2000/XP

Prerequisites

In order to run refdb you'll need a few external apps. The most important thing are the Cygwin tools which provide a Unix-like environment on the otherwise incompatible Windows platform. Additionally you'll have to build or obtain prebuilt versions of a few libraries which are not part of the standard Cygwin distribution (unless you use prebuilt binaries that contain all non-standard libraries).

External applications

  • Cygwin toolkit, DLL version 1.5.0 or later (the current "stable" version 1.3.22 does not work with the Cygwin port of PostgreSQL). The Cygwin distribution uses individual packages for the various parts. In addition to what is installed automatically (the base distribution), please make sure to select the following packages: libxml2, libxslt, expat, Perl, and a full TeX installation if you wish to create Postscript or PDF files.

  • A SQL database engine. Currently you can choose between MySQL (version 3.23 or later) and PostgreSQL (version 7.1 or later). The database server does not have to physically run on the box(es) where you plan to install refdb, it is sufficient if it is accessible through the network.

    Cygwin offers a prepackaged version of PostgreSQL (7.3.3 as of this writing) which is probably the most convenient way to run a database server on your Cygwin box. Please follow the instructions in the readme shipped with the package to install and initialize the database server. It is crucial that you install and run the separately available cygipc package, available only here.

    Other database engines are not supported yet on the Windows platform.

  • If you want to import Pubmed or MARC datasets, please make sure to install the Perl interpreter available for Cygwin and get the refdb-perlmod package. This collection of Perl modules is required to run the Pubmed and MARC import filters shipped with refdb. These Perl modules in turn depend on MARC::Record, MARC::Charset, XML::Parser, available at CPAN.

  • If you plan to use the web interface of refdb, you also need a web server. If this happens to be a different Windows box in your network, please keep in mind that you will have to install one of the refdb clients as a CGI application, so this box must run Cygwin as well. If you don't have big bucks to spend: there is a Cygwin port of Apache and a native Win32 version, either of which may suit your needs.

The mentioned websites offer plenty of support as web documents or with mailing lists, so it should be possible to figure out how to do a basic install for these suites.

Libraries

  • The libdbi library and headers, along with the libdbi-drivers package. Please follow the Cygwin-specific instructions that accompany both packages to build and install the software. Currently only MySQL and PostgreSQL are supported on Cygwin. The mSQL driver might work too, but is untested. Prebuilt binaries for both libdbi and libdbi-drivers are available here.

  • If you need the BibTeX import filter, you'll also want to have the btparse library. This builds out of the tarball on Cygwin.

Installation from the sources

Note: Depending on the permission settings, you may have to run the installation steps proper (as opposed to the build steps) as an administrator.

  1. Unpack the sources in a convenient directory: tar -xzf refdb-x.y.z.tar.gz (the exact filename depends on the version).

  2. If you do not want to build in the source directory, create an empty build directory.

  3. Change into the new refdb-x.y.z source directory or into your separate build directory.

  4. ./configure --help

    This command will display a list of things you can customize. If you build in a separate directory, use the relative path to configure in the source directory. Some important options are:

    Note: All paths and URLs in the following options should be entered without a trailing slash.

    --prefix=PREFIX

    By default, all files will be installed in the /usr/local tree. Use this option to use a different install root, e.g. /usr or /opt.

    --datadir=DIR

    The data files will be installed in /usr/local/share/refdb unless you use this option. The data will be installed in the directory DIR/refdb. That is, specifying "--datadir=/usr/local/share" is equivalent to the default behaviour. The configuration variable refdblib (which will be automatically generated in the example configuration files) must point to the refdb data directory.

    --sysconfdir=DIR

    The global configuration files will be installed in /usr/local/etc/refdb unless you specify a different directory here.

    --with-libdbi-lib=DIR

    Use this option to specify the directory that contains the libdbi library if it is not in the default library path.

    --with-expat-lib=DIR

    Use this option to specify the directory that contains the expat library if it is not in the default library path.

    --with-btparse-lib=DIR

    Use this option to specify the directory that contains the btparse library if it is not in the default library path.

    --with-sgml-declaration=PATH

    Specify the full path to a suitable SGML declaration for your SGML files. If this option is not used, refdb will use its own copy of docbook.dcl stolen from the DocBook DTD distribution. This SGML declaration also works for a variety of other DTDs.

    --with-xml-declaration=PATH

    Specify the full path to xml.dcl which is the SGML declaration for XML files. If this option is not used, refdb will use its own copy of xml.dcl which should work just fine.

    --with-docbook-xsl=PATH

    Specify the full path to the root directory of the DocBook XSL stylesheets.

    --with-tei-xsl=PATH

    Specify the full path to the root directory of the TEI XSL stylesheets.

    Note: The TEI Consortium ships two archives teixsl-fo.zip and teixsl-html.zip. refdb expects the contents of these archives in two subdirectories of the TEI XSL stylesheet root directory. If you e.g. use /usr/local/share/xsl/tei as the TEI XSL stylesheet root directory, unpack the contents of teixsl-fo.zip and teixsl-html.zip into /usr/local/share/xsl/tei/teixsl-fo and /usr/local/share/xsl/tei/teixsl-html, respectively.

    --with-classpath-root=PATH

    The refdbxml script assumes that all Java classes for the Java parsers and xslt engines are stored in a class repository, i.e. all in the same directory. Specify this directory with this option. If you keep the relevant Java classes in different directories, either create symlinks or customize refdbxml manually.

    --with-refdb-url=URL

    The HTML files and templates for the web interface require absolute URLs matching your web server setup. Specify the URL of the directory that contains the refdb HTML files. If you follow the Apache setup instructions in this manual, this will be a string like "http://www.mycomp.com/refdb", where "www.mycomp.com" is the hostname of your computer running Apache and "refdb" is the directory alias used for the refdb web pages.

    Note: This URL affects the links in the HTML files and templates. A wrong or missing value of this URL will break the navigation as well as the access to stylesheets and javascript files.

    --with-var-dir=PATH

    Use this option to specify a directory where refdbd can write its PID file (a file containing the process ID). By default, /var/run will be used.

    --with-log-dir=PATH

    Use this option to specify a directory where refdb programs can write log files to, if logging is directed to a custom file. By default, /var/log will be used.

    --with-db-server=DBS

    By default, all configuration files are preconfigured for use with the MySQL database server. Use this option to preconfigure the configuration files for a different database server (currently mysql, pgsql, and sqlite are recognized as values for DBS).

    Note: This option does not modify the binaries that you will create. These will work with all supported database engines regardless of what you select here. The only things affected by this option are a few settings in the refdbdrc configuration file. You can change them after the installation anytime.

    Finally, run ./configure with any options that you need. If you build in a separate directory, use the relative path to configure in the source directory. A complete set of options might look like this if you use PostgreSQL:

    $~ ./configure --with-refdb-url=http://yourbox.com/refdb --with-db-server=pgsql --with-var-dir=/var/run --with-log-dir=/var/log --with-libdbi-dir=/uar/local/lib --with-docbook-xsl=/usr/local/share/sgml/stylesheets/docbook --with-tei-xsl=/usr/local/share/xsl/tei
    
  5. Run make. This will create the executables and adapt scripts and other files to your local installation.

  6. make install will copy the application server and the clients to /usr/local/bin and the data files to /usr/local/share/refdb unless you chose different directories in the configure step.

  7. To finish the installation, please follow the instructions in the section Finishing the refdb installation below.

Now you have everything in place to use the refdb clients and the application server from the command line. To install the application server as a service, the following additional steps are necessary:

  1. Install the service with the command cygrunsrv -I refdbd -p /usr/local/bin/refdbd -a '-s' (adapt the paths to your local installation if necessary).

  2. Start the service with the command cygrunsrv -S refdbd. To stop the service, use the command cygrunsrv -E refdbd. If you prefer, you can also start and stop the service with NT's own tools: Either use the NT system control panel or use the NT commands net start refdbd and net stop refdbd.

With this setup, the service will be automatically started at system startup. See cygrunsrv --help for additional options.

Installation of prebuilt binaries

If you decide to grab the prebuilt binaries, the installation will be a little bit faster. The binaries are accompanied by a copy of libexpat. Please make sure to read the aptly named Readme files as they may have newer or additional information.

  1. Unpack the archive in the root directory (/) with the command tar -xzf refdb-cygwin-bin-x.y.z.tar.gz (the exact archive name depends on the version you use). This will extract the files into the /usr/local hierarchy. The binaries and scripts go to /usr/local/bin, the Document Type Definitions, stylesheets, styles and example configuration files go to /usr/local/share/refdb and its subdirectories.

  2. Unpack the prebuilt binaries for both libdbi and libdbi-drivers, available here, in the very same way.

  3. Add /usr/local/share/refdb/refdb.cat to your SGML_CATALOG_FILES environment variable.

  4. Create the configuration files in /usr/local/etc. Sample configuration files with a .example extension are created in the same directory during the installation. Provide personalized copies for the user's home directories as needed.

  5. To install refdbd as a service, follow the instructions above.