Difference between revisions of "Installing EPrints 3 on OS X"

From EPrints Documentation
Jump to: navigation, search
m (Downloading EPrints)
Line 1: Line 1:
http://www.eprints.org/documentation/handbook/osx.php
+
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.
  
Notes:
+
=Initial Setup=
  
* Apache 2 should be installed from source along with mod_perl 2. The PerlHeaderParserHandler change is no longer necessary
+
==Downloading EPrints==
* All packages are now available as native OS X apps, so fink is not required.
+
EPrints can be downloaded from the [http://files.eprints.org/view/type/release.html 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;
 +
 
 +
<pre>
 +
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
 +
</pre>
 +
 
 +
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;
 +
 
 +
<pre>
 +
dscl . -create /Groups/eprints
 +
dscl . -create /Groups/eprints RealName "EPrints Group"
 +
dscl . -create /Groups/eprints gid 400
 +
dscl . -create /Groups/eprints GroupMembership eprints
 +
</pre>
 +
 
 +
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 [[http://www.macports.org/ MacPorts]] or [[http://finkproject.org 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 [[http://dev.mysql.com/downloads/]]. The current stable version of MySQL is 5.1.
  
'''N.B.''' This document is currently a work in progress - you should be able to get by with the installation instructions above for the time being.
+
===LaTeX===
 +
To install ''latex'' and ''dvips'' on OS X you can install [[http://www.tug.org/mactex 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.
  
==Creating a user and group for EPrints==
+
===pdftotext===
 +
This is not available on MacPorts or Fink but you can download it from [[http://www.bluem.net/en/mac/others]]. Like MacTeX it is another package installer.
  
'''Note:''' This document assumes that you have used the same username, group name and home directory as listed in this section. If you choose to use different values (not recommended) then you will need to remember to use those at the appropriate places.
+
===Antiword===
 +
MacPorts:
 +
<pre>
 +
sudo port install antiword
 +
</pre>
  
==Downloading EPrints==
+
Fink:
 +
<pre>
 +
sudo fink install antiword
 +
</pre>
 +
 
 +
===Elinks===
 +
MacPorts:
 +
<pre>
 +
sudo port install elinks
 +
</pre>
 +
 
 +
Fink:
 +
<pre>
 +
sudo fink install elinks
 +
</pre>
 +
 
 +
===wget===
 +
MacPorts:
 +
<pre>
 +
sudo port install wget
 +
</pre>
 +
 
 +
Fink:
 +
<pre>
 +
sudo fink install wget
 +
</pre>
 +
 
 +
===DBD::mysql===
 +
This Perl module is available from CPAN. CPAN is available in Snow Leopard by default. You can install it by running;
 +
<pre>
 +
sudo cpan DBD::mysql
 +
</pre>
 +
 
 +
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;
 +
<pre>
 +
sudo cpan DBD::String
 +
</pre>
 +
 
 +
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;
 +
 
 +
<pre>
 +
./configure
 +
</pre>
 +
 
 +
If you need to change any settings then you can run;
  
EPrints can be downloaded from the [http://files.eprints.org/view/type/release.html releases page]. You should choose the latest stable version, i.e. nothing marked with 'alpha', 'beta', 'release candidate' or 'RC', and download this to the home directory of the eprints user (/opt/eprints3).
+
<pre>
 +
./configure --help
 +
</pre>
  
==Prerequisites==
+
Once you have done this you should run;
  
'''Important:''' All applications and Perl modules should be installed as the root user.
+
<pre>
 +
sudo ./install.pl
 +
</pre>
  
===Applications===
+
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.
  
General application prerequisites for EPrints include:
+
==Create an EPrints Repository==
* Apache Web Server 2 (preferably 2.2.x)
+
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;
* MySQL (preferably 5.0 or later - it is possible (but not recommended) to use MySQL 4)
 
* PHP (preferably 5.0 or later)
 
* mod_perl 2
 
You can either install these packages individually from source or using a package management utility such as fink (highly recommended), or you can install a software package which includes all of these applications, such as [http://www.apachefriends.org/en/xampp.html xampp].
 
  
You will also need the following applications installed in order to install EPrints:
+
<pre>
 +
sudo su eprints
 +
cd
 +
</pre>
  
* expat
+
Now run;
* imagemagick
 
* tetex
 
* tar
 
* unzip
 
* wget
 
  
All of these applications are now available as native OS X applications, and may already be installed on your system. However, you may find it easier to install them using fink.
+
<pre>
 +
bin/epadmin create
 +
</pre>
  
====Installing via fink (optional)====
+
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.
  
If you do not already have fink installed, you should download it from the [http://www.finkproject.org Fink project website]. Once fink is installed, you need to ensure that you are running the latest version using the following command:
+
==Setup Apache==
fink selfupdate-rsync
+
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.
'''N.B.''' The fink documentation will often tell you to simply use 'fink selfupdate', however this may not always work (especially if you are updating from an older version of fink on 10.4).
 
  
Once fink is installed and updated you can install all of the EPrints dependencies using the following commands:
+
First make sure that mod_perl is enabled, just add the following line to ''/etc/apache2/httpd.conf'';
fink install exoat
 
fink install imagemagick
 
fink install tetex
 
fink install tar
 
fink install unzip
 
fink install wget
 
  
===Perl modules===
+
<pre>
 +
LoadModule perl_module libexec/apache2/mod_perl.so
 +
</pre>
  
There are a number of Perl modules which require installation before EPrints can be compiled. Some setup work is required beforehand, which can be accomplished by running the following commands:
+
Next in ''/etc/apache2/other'' create a file called ''perl.conf'' and put the following inside it;
cd /usr/include
 
h2ph */*
 
export EXPATLIBPATH=/sw/lib/
 
export EXPATINCPATH=/sw/include/
 
export PATH=$PATH:/usr/local/bin/
 
  
Once these commands have been executed, change to the directory where you extracted eprints and run the following command:
+
<pre>
perl perlmodules.pl
+
<IfModule perl_module>
This should download and install all of the required Perl modules and their dependencies. You may be prompted to configure CPAN at this stage if you have not already done so.
+
  AddHandler cgi-script .pl
 +
  <IfModule dir_module>
 +
    DirectoryIndex index.pl index.html
 +
  </IfModule>
 +
</IfModule>
 +
</pre>
  
==Credits==
+
Finally in ''/etc/apache2/extra/httpd-vhosts.conf'' just add the EPrints Apache configuration before your first VirtualHost definition.
  
This document is based on the original [http://www.eprints.org/documentation/handbook/osx.php Mac OS X installation guide], with updates for new versions of software, removal of instructions which are no longer necessary, and more detail on common problems which you may run into when installing EPrints on OS X.
+
Once you have made these changes, restart apache and everything should be up and running.
  
 
[[Category:Installation]]
 
[[Category:Installation]]

Revision as of 16:08, 22 September 2009

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.