Installing on RedHat Enterprise 4

From EPrints Documentation
Revision as of 13:46, 22 June 2007 by Ckeene (talk | contribs) (revert...)
Jump to: navigation, search

Here is my step by step guide to getting EPrints 2.3.10 to install on a brand new Red Hat Enterprise Linux 4 install.

There may be some more issues that arrise, if you have a workaround, please add it. If it's just a bug, please leave a comment at the end of this page so I can try and resolve it.

Install Linux and Prerequisites

Install Red Hat Enterprise Linux 4, the latest Update [=ISOs=] are available through Red Hat Network. If RHN is working, use it to get all the required packages:

up2date -u httpd wget gunzip xpdf lynx unzip
up2date -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 mysql-server

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

up2date tetex-latex ImageMagick

Other perl modules

EPrints requires several perl modules not available through RHN. One place to get them is from Dag Wieers' high-quality repository, see Install other perl modules like this:

rpm --import
cat >> /etc/sysconfig/rhn/sources <<EOF
yum dag-rhel-4
up2date -u perl-Data-ShowTable perl-MIME-Base64 perl-Unicode-String
# turn off Dag's repo when not using 
sed -i 's;yum dag;#yum dag;g' /etc/sysconfig/rhn/sources

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


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).

Install EPrints


cd /root
tar xzvf eprints-2.3.10.tar.gz

Add an "eprints" user and group

useradd eprints

This will create a user and group called eprints. Alternatively, you can run EPrints as user/group apache.

Configure and install

Find out what your outgoing SMTP (email) server is and put it in the configuration options.

./configure --with-smtp-server

Set up apache

Edit the apache config:

vi /etc/httpd/conf/httpd.conf

In httpd.conf, change the "User" and "Group" to be "eprints"

User eprints
Group eprints

Also in httpd.conf add this to the end:

Include /opt/eprints2/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 /opt/eprints2/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.

Configure an archive

Now start setting up an archive. See the main documentation for details.


Seems to install, but nothing runs

SELinux (Security-Enhanced Linux) restricts Apache to the /var/www/ directory, see for more information or turn it off with:

setenforce 0 
sed -i 's;SELINUX=.*;SELINUX=disabled;' /etc/sysconfig/selinux

Problem starting apache?

The apache which comes with RH Enterprise 4 has https configured, but no certificate. This means when you try to start apache, it may give an error message that it needs a certificate. If this happens you have two options:

  • make a certificate, this is only needed if you intend to use https
  • disable https

To disable https: comment out (adding a # to the start of each line) all the lines in "/etc/httpd/conf.d/ssl.conf". Do not delete this file as if you do, and then upgrade apache using RPMs, the new RPM will just recreate the file. If it exists and has been modified then it won't.

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.

RHEL 4 mod_perl "Apache2::Const::OK" not allowed while "strict subs"

The current distributed version of mod_perl on RHEL 4 is 1.99, there seems to be some compatibility issues with this release which may cause Apache to fail on startup. Research suggests upgrading the module to at least vesion 2.0.1. If you use the stock install of RHEL 4 this is a little tricky, however RH do have a Beta channel that can be subscribed to in order to load the required version.

Use with CAUTION this is only Beta, don't blame me if something goes wrong on your production server!

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

In RHN select your system profile, Alter Channel Subscriptions, pick this channel from the list and apply.

On the command line :

up2date -u mod_perl

This will install mod_perl 2.0.2 AND upgrade Perl to 5.8.8 - BEWARE this may cause problems with other applications on the server test everything!

Hope this helps, Neil Marjoram.