Difference between revisions of "Installing EPrints on RHEL/Fedora/CentOS"

From EPrints Documentation
Jump to: navigation, search
m
m
 
(37 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
==Requirements==
 
==Requirements==
  
* RedHat Enterprise (RHEL) / CentOS 7 or Fedora 25+ (earlier versions may work)  
+
* RedHat Enterprise (RHEL) / CentOS 7 or Fedora 25+.  These instructions will more than likely work for RHEL / CentOS 6 but have not been as thoroughly tested.
   
+
 
== Installing from EPrints 3.3.x RPM ==
+
* Pre-installed MySQL server and client.
 +
** RHEL / Fedora:
 +
yum install mysql-server mysql
 +
** CentOS:
 +
yum install mariadb-server mariadb
 +
 
 +
== Installing from EPrints RPM ==
 +
 
 +
 
 +
The below instructions should still work for installing EPrints up to v3.3.15 on RHEL/CentOS 6 and 7 and comparable versions of Fedora.'''
 +
 
 +
=== Installing from rpm.eprints.org ===
 +
'''Please note that rpm.eprints.org is no longer fully supported and packages are no longer signed.  It is planned to start signing packages again in the future but there have been some issues with the signing keys.'''
 +
 
 +
* As root, edit /etc/yum.repos.d/eprints.repo and add the following (If you want to install EPrints 3.4 rather than EPrints 3.3 change the baseurl to ''http://rpm.eprints.org/eprints'''3.4'''''):
 +
[eprints]
 +
name=EPrints Repository Software - $basearch
 +
baseurl=http://rpm.eprints.org/eprints
 +
enabled=1
 +
gpgcheck=0
 +
 
 +
* As root, now run the following command to download the cache for this new YUM repository (or dnf in RHEL/CentOS 8+ and more recent Fedora versions)
 +
  yum makecache
 +
dnf makecache
 +
 
 +
* Finally, install EPrints using yum
 +
yum install eprints
 +
dnf install eprints
 +
 
 +
=== Installing RPM locally ====
 +
* Download latest RPM for EPrints 3.3 or 3.4 from http://files.eprints.org/
 +
 
 +
* Then install EPrints using yum (or dnf in RHEL/CentOS 8+ and more recent Fedora versions) substituting for the filename of the file you downloaded from  files.eprints.org
 +
yum install eprints-3.3.16-1.el7.rpm
 +
dnf install eprints-3.4.2-1.el7.pm
 +
 
 +
== Installing EPrints 3.4.x from Source ==
 +
'''N.B. Installing from source is generally discouraged particularly for production repositories.  However, if want to develop the EPrints code or a plugin or Bazaar package it may be useful to install from source, ideally from [https://github.com/eprints/eprints3.4 EPrints Core Git repository].'''
 +
 
 +
First, install the EPEL YUM package repository and run yum repolist to ensure the GPG key is installed:
  
Add the rpm.eprints.org repository key:
+
yum install epel-release
 +
yum repolist
  
rpm -ivh http://rpm.eprints.org/rpm-eprints-org-key-1-1.noarch.rpm
+
Now, install all the dependencies that would be installed through the eprints RPM.
  
... the rpm.eprints.org EPrints repository:
+
yum install libxml2 libxslt httpd mod_perl perl-DBI perl-DBD-MySQL perl-IO-Socket-SSL perl-Time-HiRes \
 +
    perl-CGI perl-Digest-MD5 perl-Digest-SHA perl-JSON perl-XML-LibXML perl-XML-LibXSLT perl-XML-SAX \
 +
    perl-MIME-Lite perl-Text-Unidecode perl-JSON perl-Unicode-Collate perl-Pod-LaTeX perl-LWP-Protocol-https \
 +
    tetex-latex wget gzip tar ImageMagick elinks poppler-utils chkconfig unzip cpan
  
rpm -ivh http://rpm.eprints.org/eprints/noarch/rpm-eprints-org-1-1.noarch.rpm
+
Next, create the eprints user
  
Upgrade your XML libraries:
+
adduser eprints
  
  yum upgrade libxml2 libxslt perl-XML-LibXML perl-XML-LibXSLT
+
Next, clone the Git repository from GitHub to /opt/ and set the eprints user as the owner. It is probably best to checkout the latest release rather than using HEAD, which may have known issues:
  
Install EPrints 3:
+
yum install git
 +
git clone https://github.com/eprints/eprints.git /opt/eprints3
 +
cd /opt/eprints3/
 +
git checkout tags/v3.4.1
 +
chown -R eprints:eprints .
  
yum install eprints  
+
Next, as the eprints user copy /opt/eprints3/perl_lib/EPrints/SystemSettings.pm.tmpl to /opt/eprints3/perl_lib/Eprints/SystemSettings.pm
  
===Other sources for dependencies===
+
EPrints is now fully installed at /opt/eprints3. However, you will not yet have a running archive. Follow the [[Getting Started with EPrints 3]] instructions to set this up.
  
The following RPM repositories may be useful for finding other non-critical dependencies required by EPrints that are not part of the core RHEL system.
+
Now update Apache configuration to set it up to use the eprints user and group, by ensuring the following lines are set thus in /etc/httpd/conf/httpd.conf:
  
http://fedoraproject.org/wiki/EPEL - Fedora Extras for RHEL.
+
User  eprints
 +
Group eprints
  
http://pkgs.repoforge.org/rpmforge-release/ - RPMforge, which covers a very large range of Perl modules plus others.
+
Now add the file /etc/httpd/conf.d/eprints.conf with the following line:
  
[http://www.imagemagick.org/script/binary-releases.php ImageMagick] provide an RPM for RHEL/CentOS 5. At time of writing the RPM requires fftw3, fltk, jasper and openexr which are available from ''RPMForge''. libwebp is available from [http://rpm.eprints.org/RHEL/5/ rpm.eprints.org].
+
Include /opt/eprints3/cfg/apache.conf
  
you may also need to tell SELinux to allow apache to talk on the network (maybe only if your database is on a separate server
+
There is a good chance your operating system will have SELinux enabled.  If so, follow the instructions under Troubleshooting for how to let EPrints do what it needs to do through SELinux.
  
setsebool -P httpd_can_network_connect=1
+
Finally, restart Apache:
  
 +
  service httpd restart
  
== Installing EPrints 3.3.x from Source ==
+
You should now be able to access your vanilla repository at the hostname you specified when running '''epadmin create''' from the [[Getting Started with EPrints 3]] instructions. You should then login as the admin user you created during this process and turn on the indexer. This can be done by clicking on the '''Admin''' link under the Logged in menu, then clicking on the '''System Tools''' tab and finally the '''Start Indexer''' button.
'''N.B. Installing from source is generally discouraged particularly for production repositories.  However, if want to develop the EPrints code or a plugin or Bazaar package it may be useful to install from source, ideally from [https://github.com/eprints/eprints EPrints Core Git repository].'''
 
  
...
+
== Non-critical Dependencies ==
 +
Some of EPrints non-core functionality may not work out of the box as these dependencies are not included as part of the RPM. Here is a list of known additional packages (and the YUM repositories in which they can be found) or CPAN modules than can be installed.
  
 +
Some of these known additional packages are only available through the Extra Packages for Enterprise Linux (EPEL) YUM repository, which can be installed as the root user as follows:
  
== Troubleshooting ==
+
yum -y install epel-release
 +
yum repolist
  
=== Failed to parse XML file ===
+
CPAN modules should be installed using the ''cpan'' command as the root user.
 +
 +
* '''perl-Geo-IP (epel)''' - Allows IRstats2 to determine the location of views/downloads for publications.]
 +
* '''perl-Spreadsheet-WriteExcel (epel)''' - To allow Multiline Excel export.
 +
* '''CPAN module Text::Refer''' - Required for EndNote import.
 +
* '''CPAN module TeX::Encode''' Required for BibTex export.
 +
* '''perl-Image-ExifTool (epel)''' - Sometimes needed to support generation of thumbnails for uploaded documents/images.
 +
* '''perl-LWP-Protocol-https (base)''' - Needed by DataCite plugin to register repository DOIs.
  
When installing EPrints on RHEL6 (may apply to other versions), If you get the error:
+
== Next steps ==
Failed to parse XML file:
 
/usr/share/eprints/lib/lang/en/phrases/system.xml: Entity: line 396: parser error : Entity 'nbsp' not defined age or title page. If there are more...
 
  
Run
+
Configure eprints per [[Getting_Started_with_EPrints_3]].
sed -i 's/'''&'''nbsp;/ /g' /usr/share/eprints/lib/lang/en/phrases/system.xml
 
  
then navigate to the root of your EPrints install (/opt/eprints or /usr/share/eprints) and run
+
== Operating System Version Specific Requirements ==
bin/generate_views *repository_id*
 
bin/epadmin reload *repository_id*
 
  
=== Upgrade from previous 3.3 ===
+
=== RHEL / CentOS 6 ===
After a upgrading from previous 3.3, your existing repository's database may need updating.
+
{{:Issues with installing EPrints on RHEL 6}}
bin/epadmin update [archive_id]
 
  
=== Using SELinux ===
+
=== RHEL / CentOS 7 ===
 +
No significant issues.
  
If you're using SELinux on your server you will need to give Apache read/write access to the documents directory for all repositories you create and the eprints var folder (indexer log, ticker files):
+
=== RHEL / CentOS 8 ===
 +
{{:Issues with installing EPrints on RHEL 8}}
  
chcon -R -h -t httpd_sys_script_rw_t /usr/share/eprints/archives/[repoid]/documents/
+
== Troubleshooting ==
chcon -R -h -t httpd_sys_script_rw_t /usr/share/eprints/var/
+
* [[EPrints and SELinux|Advice for enabling SELinux with EPrints]]

Latest revision as of 12:54, 20 August 2020


Requirements

  • RedHat Enterprise (RHEL) / CentOS 7 or Fedora 25+. These instructions will more than likely work for RHEL / CentOS 6 but have not been as thoroughly tested.
  • Pre-installed MySQL server and client.
    • RHEL / Fedora:
yum install mysql-server mysql
    • CentOS:
yum install mariadb-server mariadb

Installing from EPrints RPM

The below instructions should still work for installing EPrints up to v3.3.15 on RHEL/CentOS 6 and 7 and comparable versions of Fedora.

Installing from rpm.eprints.org

Please note that rpm.eprints.org is no longer fully supported and packages are no longer signed. It is planned to start signing packages again in the future but there have been some issues with the signing keys.

  • As root, edit /etc/yum.repos.d/eprints.repo and add the following (If you want to install EPrints 3.4 rather than EPrints 3.3 change the baseurl to http://rpm.eprints.org/eprints3.4):
[eprints]
name=EPrints Repository Software - $basearch
baseurl=http://rpm.eprints.org/eprints
enabled=1
gpgcheck=0
  • As root, now run the following command to download the cache for this new YUM repository (or dnf in RHEL/CentOS 8+ and more recent Fedora versions)
yum makecache
dnf makecache
  • Finally, install EPrints using yum
yum install eprints
dnf install eprints

Installing RPM locally =

  • Then install EPrints using yum (or dnf in RHEL/CentOS 8+ and more recent Fedora versions) substituting for the filename of the file you downloaded from files.eprints.org
yum install eprints-3.3.16-1.el7.rpm
dnf install eprints-3.4.2-1.el7.pm

Installing EPrints 3.4.x from Source

N.B. Installing from source is generally discouraged particularly for production repositories. However, if want to develop the EPrints code or a plugin or Bazaar package it may be useful to install from source, ideally from EPrints Core Git repository.

First, install the EPEL YUM package repository and run yum repolist to ensure the GPG key is installed:

yum install epel-release
yum repolist

Now, install all the dependencies that would be installed through the eprints RPM.

yum install libxml2 libxslt httpd mod_perl perl-DBI perl-DBD-MySQL perl-IO-Socket-SSL perl-Time-HiRes \
    perl-CGI perl-Digest-MD5 perl-Digest-SHA perl-JSON perl-XML-LibXML perl-XML-LibXSLT perl-XML-SAX \
    perl-MIME-Lite perl-Text-Unidecode perl-JSON perl-Unicode-Collate perl-Pod-LaTeX perl-LWP-Protocol-https \ 
    tetex-latex wget gzip tar ImageMagick elinks poppler-utils chkconfig unzip cpan

Next, create the eprints user

adduser eprints

Next, clone the Git repository from GitHub to /opt/ and set the eprints user as the owner. It is probably best to checkout the latest release rather than using HEAD, which may have known issues:

yum install git
git clone https://github.com/eprints/eprints.git /opt/eprints3
cd /opt/eprints3/
git checkout tags/v3.4.1
chown -R eprints:eprints . 

Next, as the eprints user copy /opt/eprints3/perl_lib/EPrints/SystemSettings.pm.tmpl to /opt/eprints3/perl_lib/Eprints/SystemSettings.pm

EPrints is now fully installed at /opt/eprints3. However, you will not yet have a running archive. Follow the Getting Started with EPrints 3 instructions to set this up.

Now update Apache configuration to set it up to use the eprints user and group, by ensuring the following lines are set thus in /etc/httpd/conf/httpd.conf:

User  eprints
Group eprints

Now add the file /etc/httpd/conf.d/eprints.conf with the following line:

Include /opt/eprints3/cfg/apache.conf

There is a good chance your operating system will have SELinux enabled. If so, follow the instructions under Troubleshooting for how to let EPrints do what it needs to do through SELinux.

Finally, restart Apache:

 service httpd restart

You should now be able to access your vanilla repository at the hostname you specified when running epadmin create from the Getting Started with EPrints 3 instructions. You should then login as the admin user you created during this process and turn on the indexer. This can be done by clicking on the Admin link under the Logged in menu, then clicking on the System Tools tab and finally the Start Indexer button.

Non-critical Dependencies

Some of EPrints non-core functionality may not work out of the box as these dependencies are not included as part of the RPM. Here is a list of known additional packages (and the YUM repositories in which they can be found) or CPAN modules than can be installed.

Some of these known additional packages are only available through the Extra Packages for Enterprise Linux (EPEL) YUM repository, which can be installed as the root user as follows:

yum -y install epel-release
yum repolist 

CPAN modules should be installed using the cpan command as the root user.

  • perl-Geo-IP (epel) - Allows IRstats2 to determine the location of views/downloads for publications.]
  • perl-Spreadsheet-WriteExcel (epel) - To allow Multiline Excel export.
  • CPAN module Text::Refer - Required for EndNote import.
  • CPAN module TeX::Encode Required for BibTex export.
  • perl-Image-ExifTool (epel) - Sometimes needed to support generation of thumbnails for uploaded documents/images.
  • perl-LWP-Protocol-https (base) - Needed by DataCite plugin to register repository DOIs.

Next steps

Configure eprints per Getting_Started_with_EPrints_3.

Operating System Version Specific Requirements

RHEL / CentOS 6

Issues when following Installing_EPrints_on_RHEL/Fedora/CentOS#Installing_from_EPrints_3.3.x_RPM.

Error installing eprints:

--> Processing Dependency: perl(Apache::DBI) for package: eprints-3.3.15-1.el6.noarch
--> Finished Dependency Resolution
Error: Package: eprints-3.3.15-1.el6.noarch (rpm-eprints-org)
           Requires: perl(Apache::DBI)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Solution is a missing package from EPEL. Add EPEL to yums configuration then installing the missing package.

yum install epel-release
yum install perl-Apache-DBI

RHEL / CentOS 7

No significant issues.

RHEL / CentOS 8

elinks package is no longer available

The RPM package elinks is no longer available in RHEL 8. elinks is probably no longer needed so if installing from source use the following YUM command line:

yum install libxml2 libxslt httpd mod_perl perl-DBI perl-DBD-MySQL perl-IO-Socket-SSL perl-Time-HiRes \
   perl-CGI perl-Digest-MD5 perl-Digest-SHA perl-JSON perl-XML-LibXML perl-XML-LibXSLT perl-XML-SAX \
   perl-MIME-Lite perl-Text-Unidecode perl-JSON perl-Unicode-Collate perl-Pod-LaTeX tetex-latex wget \
   gzip tar ImageMagick poppler-utils chkconfig unzip cpan

Compatibility issues with XML::LibXLST

Sometimes the Perl module XML::LibXLST packaged in the perl-XML-LibXSLT package causes segmentation faults with the Apache httpd webserver. Therefore, it may be better to install this Perl module using CPAN (as the root user):

yum erase perl-XML-LibXSLT
cpan XML::LibXSLT

Troubleshooting