Installing EPrints on RHEL/Fedora/CentOS
Contents
Requirements
- RedHat Enterprise (RHEL) / CentOS 8, 9 or 10 (or Fedora 28+).
- Pre-install and enable the EPEL YUM/DNF repository.
yum install epel-release
- Pre-install and enable the CoreReady Builder YUM/DNF repository.
- RHEL
subscription-manager repos --enable "codeready-builder-for-rhel-$($releasever)-$(arch)-rpms"
- CentOS Stream / Rocky Linux 8
dnf config-manager --set-enabled powertools
- CentOS Stream / Rocky Linux 9 and 10
dnf config-manager --set-enabled crb
- RHEL
- Pre-install MySQL server and client and make sure the former is enabled and running.
- RHEL / Fedora:
yum install mysql-server mysql mysql-devel
systemctl enable --now mysqld
- CentOS / Rocky Linux:
yum install mariadb-server mariadb mariadb-devel
systemctl enable --now mariadb
- RHEL / Fedora:
- From the MySQL command prompt, pre-configure an eprints user with password for MariaDB/MySQL. (Be sure to change the password from "changeme"):
CREATE USER 'eprints'@'localhost' IDENTIFIED by 'changeme';
GRANT ALL PRIVILEGES ON *.* TO 'eprints'@'localhost' WITH GRANT OPTION;
Installing EPrints 3.4.6 from Source
Ideally you will install from source from EPrints Core Git repository. Installing from source is now the preferred way to install production repositories, having previously proved to be a useful installation method for those wishing to develop EPrints code or a plugin or Bazaar package too.
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-Apache-DBI perl-DBI perl-DBD-MySQL perl-IO-Socket-SSL \ perl-Time-HiRes perl-CGI perl-Digest-MD5 perl-Digest-SHA perl-Digest-SHA1 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 perl-IO-String tetex-latex wget gzip tar ImageMagick \ poppler-utils chkconfig unzip cpan python3-html2text expat-devel libxslt-devel
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 mkdir /opt/eprints3 chown eprints:eprints /opt/eprints3 chmod 2775 /opt/eprints3 su eprints git clone https://github.com/eprints/eprints3.4.git /opt/eprints3 cd /opt/eprints3/ git checkout tags/v3.4.6
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 installation process. 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. The latter 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. (RHEL/CentOS/Rocky Linux 8 only)
- perl-GeoIP2 (@System and epel) - Allows IRstats2 to determine the location of views/downloads for publications. (RHEL/CentOS/Rocky Linux 9+)
- 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 needed for publications flavour.
- 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 / Rocky 8
No known issues if running at least EPrints 3.4.6.
RHEL / CentOS / Rocky 9
No known issues if running at least EPrints 3.4.6.
RHEL / CentOS / Rocky 10
No other known issues beyond those below if running at least EPrints 3.4.6.
mod_perl cannot handle dir_perms parameter
By default EPrints is configures its dir_perms parameter to 02775
in perl_lib/EPrints/SystemSettings.pm and lib/syscfg.d/core.pl. This is used when creating a new directory with EPrints::System::mkdir, which call CORE::mkdir. Previously this core Perl function has ignored the mask for the setuid/setgid/sticky bit so it did not matter^ if dir_perms was 02775
or 0775
but the version of mod_perl used on RHEL-based Linux 10 now gets confused by this and will fail to create directory. To fix this you will need to modify lib/syscfg.d/core.pl and set $c->{dir_perms}
as follows:
$c->{dir_perms} = '0775';
In addition, to make sure that the setgid bit gets set the same as it would before, it is advised you make sure all the sub-directories in your archive have the setgid bit set:
find EPRINTS_PATH/archives/ARCHIVE_ID -type d -exec chmod g+s {} \;
Technically, it should not be necessary to do this to all directories, it might be sufficient to do this only to the html and documents directories, as well as their sub-directories but there should not be any problem updating all the archive's directories.
^This is why EPrints::System::mkdir would subsequently called CORE::chmod to update setuid/setgid/sticky bits on the newly created directories.
Troubleshooting
- If setup is successful but then you cannot access EPrints through your web browser this is often due to firewalld being enabled by default on recent versions of RHEL, Fedora and CentOS. If firewalld is running either disable it (systemctl disable --now firewalld) or configure it to allow HTTP/HTTPS traffic.
- If you are having problems uploading files or similar functional issues, this may be due to SELinux being enabled. See advice for enabling SELinux with EPrints.
- If you are having trouble getting additional subdomains beyond username.eprints-hosting.org working, then it could be you need wildcards enabled on the DNS records to facilitate the likes of somethingcoolhere.username.eprints-hosting.org urls.