Installing EPrints 3 on RedHat Enterprise 4

From EPrints Documentation
Revision as of 13:54, 10 November 2006 by Neilmarj (Talk | contribs)

Jump to: navigation, search

Installing EPrints 3 on Redhat Enterpise 4

This guide has been written by combining the instructions for Eprints version 2, other contributions written by previous authors (Thanks guys!) and my experience with installing on my system. Please feel free to add, edit and put right anything I have got wrong!

Install Prerequisites

Install Red Hat Enterprise Linux 4 and the latest Updates available through Red Hat Network. If RHN is working, use it to get all the required packages:

up2date --nox -u httpd wget gzip xpdf lynx unzip
up2date --nox -u mod_perl perl-DBI perl-DBD-MySQL perl-XML-Parser

Note: you will need to make sure your machine has the "Extras" channel in RHN or install mysql-server from the 'extras' disk, even if you selected to install MySQL in the menus:

up2date --nox -u mysql-server

If you want the LaTeX functionality install a TeX system and ImageMagick:

up2date --nox -u tetex-latex ImageMagick

You will needthe glib-devel and libxml2-devel package for GDOME

up2date --nox -u  glib-devel libxml2-devel-2.6.16-6


I have found that the RHEL mod_perl version 2 is of course not version 2, but beta 1.99. RH offer mod_perl 2, but only in the Web Application Channel. This should be OK, on RHN alter your channel subscription and include :

Red Hat Web Application Stack 1.0 Beta (for AS v. 4 x86)

Then from the command line :

up2date --nox -u mod_perl

This will install mod perl 2.02 (latest) and un update to Perl.

Once loaded please alter the channel subscription back to your normal list.

Other Perl Modules

You can use CPAN with the automated script which comes with eprints; run "cpan" and answer the questions.

perl -MCPAN -e shell
install Data::ShowTable
install MIME::Base64
install Unicode::String
install Term::ReadKey
install MIME::Lite
install XML::LibXML
install CGI (This is an update as I found RHEL dist has a bug for something else)

Accept and requirements, but don't worry about any modules already installed, then exit cpan (type exit) and run the perlmodule installer which came with EPrints.

Make sure apache & mysql start when you reboot

/sbin/chkconfig mysqld on
/sbin/chkconfig httpd on

If you really want to install GDOME, see the appendix at the bottom of this page. GDOME has not been updated in years and in my experience perl-XML-DOM performs well on modern machines (searching hundreds of documents in less than 1 second on a Pentium 4).

Installing Eprints Version 3

Download Latest Version :

cd /usr/local/build
wget ??? Anyone?

Unpack the distribution and compile (note I am running as apache user not eprints):

tar xzvf  eprints-3.0-beta-1.tar.gz
cd eprints-3.0-beta-1    
./configure --with-smtp-server --prefix=/{rootinst}/eprints --with-user=apache --with-group=apache 

Configure Apache

Edit the apache config:

vi /etc/httpd/conf/httpd.conf

add this to the end:

Include /var/lib/eprints/cfg/apache.conf

Set up the indexer as a linux service

To make the indexer into a service which starts and stops on reboots etc. like httpd and mysqld do the following (as root):

ln -s /var/lib/eprints/bin/epindexer /etc/init.d/epindexer
chkconfig --add epindexer
chkconfig epindexer on

The epindexer script runs as root, changes user to "eprints" (or whatever uid your eprints install runs as) and then calls indexer.

Configuring Eprints

The configuration of Eprints has slightly changed since version 2.

All commands should be run as the Eprints user (apache in my case)

 su - apache


Edit the file :

perl_lib/EPrints/XML/ and find the line :

$EPrints::XML::PREFIX = "XML::DOM::";

Below it add :

*XML::DOM::Document::documentElement = \&XML::DOM::Document::getDocumentElement;
*XML::DOM::Node::ownerDocument = \&XML::DOM::Node::getOwnerDocument;
*XML::DOM::Node::attributes = sub { shift->getAttributes(@_) };
*XML::DOM::Node::nodeName = sub { shift->getNodeName(@_) };
*XML::DOM::Node::nodeValue = sub { shift->getNodeValue(@_) };
*XML::DOM::Node::nodeType = sub { shift->getNodeType(@_) };
*XML::DOM::Attr::name = \&XML::DOM::Attr::getName;
*XML::DOM::Attr::nodeName = \&XML::DOM::Attr::getName;
*XML::DOM::Attr::value = \&XML::DOM::Attr::getValue;
*XML::DOM::Attr::nodeValue = \&XML::DOM::Attr::getValue;
*XML::DOM::Element::tagName = \&XML::DOM::Element::getTagName;
*XML::DOM::NamedNodeMap::length = \&XML::DOM::NamedNodeMap::getLength;
*XML::DOM::Element::hasAttribute = sub { defined(shift->getAttributeNode(@_)) }; 


Start the configuration script :

cd /var/lib/eprints


Installing GDOME and the perl GDOME interface

This is not essential. Non-RH RPMs are available at

libxml2 should already be installed.

Install the GDOME rpms.

cd /root
rpm -Uvh gdome2-0.8.1-1.i386.rpm gdome2-devel-0.8.1-1.i386.rpm

(You can get more recent versions if they are available).

Fix the bug in gdome-config

When I installed gdome-config it appeared to have a slight error when it installed.

To see if the bug is a problem run:

gdome-config --libs 

If you get something like:

/usr/bin/gdome-config: line 86: --libs: command not found
/usr/bin/gdome-config: line 87: --cflags: command not found

then you need to fix the bug. Don't worry, it's easy.

As root edit /usr/bin/gdome-config

vi /usr/bin/gdome-config

Around line 88 find these two lines:

the_libs="$the_libs -L${exec_prefix}/lib -lgdome ` --libs` `xml2-config --libs`"
the_flags="$the_flags -I${prefix}/include -I${prefix}/include/libgdome ` --cflags` `xml2-config --cflags`"

And change them to this:

the_libs="$the_libs -L${exec_prefix}/lib -lgdome `/usr/bin/glib-config --libs` `xml2-config --libs`"
the_flags="$the_flags -I${prefix}/include -I${prefix}/include/libgdome `/usr/bin/glib-config --cflags` `xml2-config --cflags`"

Install XML::GDOME

note: you need the RPM glib-devel installed for this to work. (Possibly "up2date glib-devel" will sort this if up2date is set up)

Do this from source, not via CPAN as one of the tests is broken.

cd /root
tar xzvf XML-GDOME-0.86.tar.gz
cd XML-GDOME-0.86
perl Makefile.PL
make install

If you want you can run "make test" before install, but don't worry about the "SAX" test failing.


This is my second install, the first on a running RHEL 4 box failed, it runs 15 or so other websites, the second install was on a new install and worked first time. I don't know as yet what the differences are, they are both patched to the same level, only difference I can see is that the first has extra perl modules installed for Request Tracker and SpammAssassin.