Difference between revisions of "Installing EPrints on RHEL/Fedora/CentOS"
m |
m |
||
Line 43: | Line 43: | ||
'''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].''' | '''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].''' | ||
− | First, install all the dependencies that would be installed through the eprints RPM | + | First, 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 \ | yum install libxml2 libxslt httpd mod_perl perl-DBI perl-DBD-MySQL perl-IO-Socket-SSL perl-Time-HiRes perl-CGI \ | ||
Line 55: | Line 55: | ||
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: | 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 | git clone https://github.com/eprints/eprints.git /opt/eprints3 | ||
git checkout tags/3.3.15 | git checkout tags/3.3.15 |
Revision as of 15:34, 1 September 2017
Contents
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.
Installing from EPrints 3.3.x RPM
Add the rpm.eprints.org repository key:
rpm -ivh http://rpm.eprints.org/rpm-eprints-org-key-1-1.noarch.rpm
Next, add the rpm.eprints.org EPrints repository:
rpm -ivh http://rpm.eprints.org/eprints/noarch/rpm-eprints-org-1-1.noarch.rpm
Then, upgrade your XML libraries:
yum upgrade libxml2 libxslt perl-XML-LibXML perl-XML-LibXSLT
Finally, install EPrints 3:
yum install eprints
Other 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.
- 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.
Installing EPrints 3.3.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 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-XML-LibXML perl-XML-LibXSLT perl-XML-SAX perl-MIME-Lite tetex-latex wget \ gzip tar ImageMagick unzip elinks poppler-utils chkconfig
Now, 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 git checkout tags/3.3.15 chown -R eprints:eprints /opt/eprints3
EPrints will now be 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
Run the following command to create /opt/eprints3/cfg/apache.conf
/opt/eprints3/bin/generate_apacheconf --system --replace
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.
Troubleshooting
Failed to parse XML file
When installing EPrints on RHEL6 (may apply to other versions), If you get the error:
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
sed -i 's/ / /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
bin/generate_views *repository_id* bin/epadmin reload *repository_id*
Upgrade from previous 3.3
After a upgrading from previous 3.3, your existing repository's database may need updating.
bin/epadmin update [archive_id]
Using SELinux
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):
chcon -R -h -t httpd_sys_script_rw_t /usr/share/eprints/archives/[repoid]/documents/ chcon -R -h -t httpd_sys_script_rw_t /usr/share/eprints/var/
You may also need to tell SELinux to allow Apache to talk on the network, if you intend to run your database on a separate server.
setsebool -P httpd_can_network_connect=1