Difference between revisions of "Installing EPrints 3 on RedHat Enterprise 4"

From EPrints Documentation
Jump to: navigation, search
Line 206: Line 206:
 
  /var/lib/eprints3/bin/import_subjects yourarchivename
 
  /var/lib/eprints3/bin/import_subjects yourarchivename
 
   
 
   
 
==Customisations made at UCL Adastral Park Campus==
 
 
These are some of the customisations made at the UCL Adastral Park Campus, the instructions here may help you to accomplish tasks at your site.
 
 
===Style Sheet Changes===
 
 
All changes to style sheet setting should be made in the directory /var/lib/eprints3/archives/yourarchivename/cfg/static/style/auto, and updated using the generate_static command. Changes made in the html directory will be overwritten.
 
 
Style sheets are processed alphabetically, eprints has a local stlye sheet setup called zzz_local.css, any changes can be made in this file, and settings from previous css files will be over writen with values in this file. I use the EditCSS function in Firefox to configure my stlye sheets and copy the modifications directly into this file.
 
 
When modifications are completed, as the user apache execute;
 
 
/var/lib/eprints3/bin/generate_static yourarchivename
 
 
===Image Changes===
 
 
Here's where I cheat! I have taken the original files and changed the colour resaving as the original file name. This can be a little confusing as some of the files caontain the colour in the title. Changed files should be saved into a new directory : /var/lib/eprints3/archives/yourarchivename/cfg/static/style/images, changes made in the html directory will be overwritten by the generate_static command.
 
 
mkdir /var/lib/eprints3/archives/yourarchivename/cfg/static/style/images
 
 
Copy edited images to above directory, as user apache run the command;
 
 
/var/lib/eprints3/bin/generate_static yourarchivename
 
 
Images will now be copied into the html directory.
 
 
===User Registration===
 
 
Disable web user registration, edit the file;
 
 
  vi /var/lib/eprints3/archives/yourarchivename/cfg/cfg.d/registration.pl
 
 
Change the line :
 
 
$c->{allow_web_signup} = 1;
 
 
to :
 
 
$c->{allow_web_signup} = 0;
 
 
Change the file;
 
 
  vi /var/lib/eprints3/archives/yourarchivename/cfg/lang/en/static/error401.xpage
 
 
  <nowiki><p><a href="{$config{perl_url}}/set_password">Register / Reset my password</a></p></nowiki>
 
 
to :
 
 
  <nowiki><p><a href="{$config{perl_url}}/set_password">Reset my password</a></p></nowiki>
 
 
 
 
To remove register link under the search, edit the file;
 
 
vi /var/lib/eprints3/archives/yourarchivename/cfg/lang/en/phrases/dynamic.xml
 
 
Change the line :
 
 
<epp:phrase id="dynamic:not_logged_in">Not logged in. <a href="{$config{userhome}}">login</a> | <a  href="{$config{perl_url}}/register">register</a></epp:phrase>
 
 
To :
 
 
<epp:phrase id="dynamic:not_logged_in">Not logged in. <a href="{$config{userhome}}">login</a></epp:phrase>
 
 
 
Then as apache user run :
 
 
/var/lib/eprints3/bin/generate_static yourachivename
 
 
As root run :
 
 
service httpd restart
 
  
 
===Front page warning===
 
===Front page warning===
Line 297: Line 224:
  
 
  /var/lib/eprints3/bin/generate_static yourachivename
 
  /var/lib/eprints3/bin/generate_static yourachivename
 
===Contact and Information pages===
 
 
Edit the file;
 
 
vi /var/lib/eprints3/archives/yourarchivename/cfg/lang/en/static/contact.xpage
 
 
And the file;
 
 
vi /var/lib/eprints3/archives/yourarchivename/cfg/lang/en/static/information.xpage
 
 
With normal site contact information.
 
 
Then as apache user run :
 
 
/var/lib/eprints3/bin/generate_static yourachivename
 
 
===Submitting with no documents===
 
 
I allow this as we may be adding documents in later after the information.
 
 
To allow a submission without a document, edit the file;
 
 
vi /var/lib/eprints3/archives/yourarchivename/cfg/cfg.d/document_upload.pl
 
 
And change the lines;
 
 
$c->{required_formats} =
 
[
 
        "text/html",
 
        "application/pdf",
 
        "application/postscript",
 
        "text/plain"
 
];
 
 
 
To :
 
 
$c->{required_formats} =
 
[
 
];
 
 
===Views by Person===
 
 
To allow users to include a list of their documents in home pages, and to genrate a view based on the author edit the file :
 
 
vi /var/lib/eprints3/archives/yourarchivename/cfg/cfg.d/views.pl
 
 
 
Add in the lines :
 
 
 
  {
 
  id=>"people",
 
  allow_null=>0,
 
  fields=>"creators_name/editors_name",
 
  order=>"title", 
 
  include=>1
 
  },
 
 
Don't forget the comma after the previous entry. This will produce out to the views section based on the persons name. It will give you text, html, and include files. I use the include file for displaying items on home pages.
 
 
For instance a link inside a users home page:
 
 
<?php
 
include ("http://eprints.adastral.ucl.ac.uk/view/people/{Family},_{Given Name}.include")
 
?>
 
 
Will give them a list of all their documents in the eprints repository, and the link :
 
 
http://eprints.adastral.ucl.ac.uk/view/people/
 
 
Will list all people that have published articles into eprints.
 
 
==Notes and bugs==
 

Revision as of 09:32, 14 December 2006

Download EPrints Releases: http://files.eprints.org/view/type/release.html


New improved for Beta 3

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!

It's a work in progress, which will be constantly updated, I will rewrite and move some of this once I have RC1 live next week.

Install Prerequisites

OS Updates

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


Mod_Perl

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.

cpan
perl -MCPAN -e shell
install Data::ShowTable
install MIME::Base64
install Unicode::String
install Term::ReadKey
install Readonly     ******NEW*******
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

Installing GDOME and the perl GDOME interface

I found I needed this for eprints to work, so maybe it is essential now!

This is not essential. Non-RH RPMs are available at http://linux.reb00t.com/RPMS/

libxml2 should already be installed.

Install the GDOME rpms.

cd /root
wget http://gdome2.cs.unibo.it/rpm/gdome2-0.8.1-1.i386.rpm 
wget http://gdome2.cs.unibo.it/rpm/gdome2-devel-0.8.1-1.i386.rpm
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 /usr/local/build
wget http://cpan.uwinnipeg.ca/cpan/authors/id/T/TJ/TJMATHER/XML-GDOME-0.86.tar.gz
tar xzvf XML-GDOME-0.86.tar.gz
cd XML-GDOME-0.86
perl Makefile.PL
make
make install

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

Installing Eprints Version 3

Download Latest Version :

cd /usr/local/build
wget http://files.eprints.org/125/01/eprints-3.0-beta-3.tar.gz

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

tar xzvf  eprints-3.0-beta-3.tar.gz
cd eprints-3.0-beta-3   
./configure --with-smtp-server=smtp.adastral.ucl.ac.uk --prefix=/var/lib/eprints3 --with-user=apache --with-group=apache 
./install.pl

Obviously you should use setting relevant to your site, a complete list of options can be generated using the command:

./configure --help

Configure Apache

Edit the apache config:

vi /etc/httpd/conf/httpd.conf

add this to the end:

Include /var/lib/eprints3/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/eprints3/bin/epindexer /etc/init.d/epindexer
chkconfig --add epindexer
chkconfig epindexer on

The epindexer script runs as root, changes user to "apache" (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
 

Start the configuration script :

cd /var/lib/eprints3
bin/epadmin create

Then setup all the other configs :

Generate static pages for your site :

bin/generate_static yourarchivename

Generate the Apache config for your site :

bin/generate_apacheconf

Generate the search views for your website :

bin/generate_views yourarchivename

Import Subjects

Edit the subjects file to match your subjects :

vi /var/lib/eprins3/archives/yourarchivename/cfg/subjects

As the apache user run the command :

/var/lib/eprints3/bin/import_subjects yourarchivename

Front page warning

Edit the page :

vi /var/lib/eprints3/archives/yourarchivename/cfg/lang/en/static/index.xpage

Remove all reference to the warning and information and replace with :

#########
Your message here
#########

Then as apache user run :

/var/lib/eprints3/bin/generate_static yourachivename