Installing EPrints 3 on OS X

From EPrints Documentation
Revision as of 16:08, 22 September 2009 by Mmr@ecs.soton.ac.uk (talk | contribs)
Jump to: navigation, search

These instructions have been written based on experiences of installing EPrints 3.1.3 on Mac OS X 10.6 Snow Leopard. The chances are that these steps will also work for Mac OS X 10.5 Leopard.

Initial Setup

Downloading EPrints

EPrints can be downloaded from the releases page. Extract it in your downloads directory or wherever you downloaded it to.

Setting Up The EPrints User and Group

Snow Leopard has now completely got rid of niutil and we now have to use dscl to setup the eprints user and group.

Run the following commands to create the eprints user;

dscl . -create /Users/eprints
dscl . -create /Users/eprints UserShell /bin/bash
dscl . -create /Users/eprints RealName "EPrints User"
dscl . -create /Users/eprints NFSHomeDirectory /opt/eprints3
dscl . -create /Users/eprints UniqueID 400
dscl . -append /Groups/staff GroupMembership eprints

By setting the user id below 400 this means that OS X will not display the eprints user in any of the user control menus. For the NFSHomeDirectory setting make sure you set this value to wherever you wish to install eprints.

Next run the following commands to create the eprints group and and the eprints user to it;

dscl . -create /Groups/eprints
dscl . -create /Groups/eprints RealName "EPrints Group"
dscl . -create /Groups/eprints gid 400
dscl . -create /Groups/eprints GroupMembership eprints

Again setting the group id below 400 will not display the eprints group in any of the group control menus.

Installing EPrints Prerequisites

Rather then dealing with all of the details of compiling from source you can use a package manager such as [MacPorts] or [Fink]. Other than for installing LaTeX this guide assumes that you are using with MacPorts or Fink. You can skip this stage if these dependencies are already installed.

MySQL

A package for installing MySQL is available from [[1]]. The current stable version of MySQL is 5.1.

LaTeX

To install latex and dvips on OS X you can install [MacTeX]. This is a fairly easy install as it is done using a standard OS X package install which handles all of the configuration details for you.

pdftotext

This is not available on MacPorts or Fink but you can download it from [[2]]. Like MacTeX it is another package installer.

Antiword

MacPorts:

sudo port install antiword

Fink:

sudo fink install antiword

Elinks

MacPorts:

sudo port install elinks

Fink:

sudo fink install elinks

wget

MacPorts:

sudo port install wget

Fink:

sudo fink install wget

DBD::mysql

This Perl module is available from CPAN. CPAN is available in Snow Leopard by default. You can install it by running;

sudo cpan DBD::mysql

If you get any prompts about setting up CPAN accepting the defaults should work.

Unicode::String

This Perl module is available from CPAN. CPAN is available in Snow Leopard by default. You can install it by running;

sudo cpan DBD::String

If you get any prompts about setting up CPAN accepting the defaults should work.

EPrints Setup

Installing EPrints

You should now have all of the dependencies fulfilled to install EPrints. The first thing to do is go to your downloaded and extracted EPrints source folder and run;

./configure

If you need to change any settings then you can run;

./configure --help

Once you have done this you should run;

sudo ./install.pl

Once that has completed you should now have EPrints installed at /opt/eprints3 or wherever you set as the installation path if you specified something different with the configure script.

Create an EPrints Repository

Now that everything is installed you need to set up your EPrints archive. First thing is to switch to the eprints user and switch to the eprints directory;

sudo su eprints
cd

Now run;

bin/epadmin create

You just need to follow the standard setup process. Make sure that your repository is set up to respond to localhost or an appropriate url. If you are working on a development machine and have multiple virtual hosts then you could use a custom url such as macprints.local but you need to make sure you add it to your /etc/hosts file.

Setup Apache

Apache is installed for you by default with Snow Leopard and you just need to complete a few pieces of configuration to get things working.

First make sure that mod_perl is enabled, just add the following line to /etc/apache2/httpd.conf;

LoadModule perl_module libexec/apache2/mod_perl.so

Next in /etc/apache2/other create a file called perl.conf and put the following inside it;

<IfModule perl_module>
  AddHandler cgi-script .pl
  <IfModule dir_module>
    DirectoryIndex index.pl index.html
  </IfModule>
</IfModule>

Finally in /etc/apache2/extra/httpd-vhosts.conf just add the EPrints Apache configuration before your first VirtualHost definition.

Once you have made these changes, restart apache and everything should be up and running.