<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.eprints.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kiz</id>
	<title>EPrints Documentation - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.eprints.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kiz"/>
	<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/Special:Contributions/Kiz"/>
	<updated>2026-04-20T20:31:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.8</generator>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Making_a_fossilised_repository&amp;diff=12362</id>
		<title>Making a fossilised repository</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Making_a_fossilised_repository&amp;diff=12362"/>
		<updated>2017-07-20T13:06:57Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Unwanted links to dynamic content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Howto]]&lt;br /&gt;
&lt;br /&gt;
(This work requires access to the database &amp;amp; original file-system)&lt;br /&gt;
&lt;br /&gt;
The rough plan is to pull all of the visible pages in the repository and make it available as a static copy - no dynamic stuff, no &lt;br /&gt;
&lt;br /&gt;
This process assumes you have access to the underlying database, and the file-store for the repo.&lt;br /&gt;
&lt;br /&gt;
Assume:&lt;br /&gt;
# you're working as a non-root user on a workstation&lt;br /&gt;
# your repo is accessable [to you] at http://my.repo/&lt;br /&gt;
# your web server will have a document-root of &amp;lt;code&amp;gt;~/www/my.repo&amp;lt;/code&amp;gt;&lt;br /&gt;
# you know how to set a document-root on your web server&lt;br /&gt;
# you'll have to do some tidying up (finding images, etc) yourself&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of the html pages ==&lt;br /&gt;
&lt;br /&gt;
   mkdir ~/www&lt;br /&gt;
   cd ~/www&lt;br /&gt;
   wget --local-encoding=UTF-8 --remote-encoding=UTF-8 --no-cache --mirror -nc -k http://my.repo/&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of all the abstract pages ==&lt;br /&gt;
You need check the database - the last eprintid in the eprints table is the number you need to count up to&lt;br /&gt;
&lt;br /&gt;
   cd my.repo&lt;br /&gt;
   for id in {1..12345} ; do wget --local-encoding=UTF-8 --remote-encoding=UTF-8 --no-cache -k http://my.repo/$id ; done&lt;br /&gt;
&lt;br /&gt;
[(a) note the lack of &amp;lt;code&amp;gt;--mirror&amp;lt;/code&amp;gt; option, abd (b) this *will* take quite a while..... but are you in a hurry?]&lt;br /&gt;
&lt;br /&gt;
This downloads each page into a file called $id, and we need to make that a directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
# run in ~/www/my.repo&lt;br /&gt;
use File::Slurp;&lt;br /&gt;
my $root = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @files = grep { /^\d/ &amp;amp;&amp;amp; -f &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $file (@files) {&lt;br /&gt;
    my $source = &amp;quot;$root/$file&amp;quot;;&lt;br /&gt;
    my $content = read_file($source, binmode =&amp;gt; ':utf8');&lt;br /&gt;
    unlink $source;&lt;br /&gt;
    mkdir $source;&lt;br /&gt;
    write_file( &amp;quot;$source/index.html&amp;quot;, {binmode =&amp;gt; ':utf8'}, $content ) ;&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of all the documents ==&lt;br /&gt;
&lt;br /&gt;
The problem here is that EPrints has a funny directory structure, which doesn't map to URLs, so we grab a copy, and then move them into the right place.&lt;br /&gt;
(Still in ~/www/my.repo/)&lt;br /&gt;
&lt;br /&gt;
    scp -r eprints_user@my.repo:/path/to/eprints/archives/opendepot/documents/disk0 .&lt;br /&gt;
&lt;br /&gt;
... will copy &amp;lt;code&amp;gt;disk0&amp;lt;/code&amp;gt; and all it's subdirectories into the current directory.&lt;br /&gt;
&lt;br /&gt;
=== Copy the documents into the right location in the web site ===&lt;br /&gt;
&lt;br /&gt;
We then use a move script to move each of the documents into the appropriate abstract directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
# you will need to tweek the root &amp;amp; number of nested loops if you have more data.&lt;br /&gt;
use File::Copy::Recursive;&lt;br /&gt;
&lt;br /&gt;
my $root = './00/00'; &lt;br /&gt;
my $destination = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @tlfs = grep { /^\w/ &amp;amp;&amp;amp; -r &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $tlf (@tlfs) {&lt;br /&gt;
    my $dir = &amp;quot;$root/$tlf&amp;quot;;&lt;br /&gt;
    opendir( my $dh, $dir) || die &amp;quot;can't open $dir\n&amp;quot;;&lt;br /&gt;
    my @blfs = grep { /^\w/ &amp;amp;&amp;amp; -r &amp;quot;$dir/$_&amp;quot; } readdir($dh);&lt;br /&gt;
    close $dh;&lt;br /&gt;
    foreach my $blf (@blfs) {&lt;br /&gt;
        my $combined = $tlf . $blf;&lt;br /&gt;
        my $final = $combined + 0;&lt;br /&gt;
        my $docs = &amp;quot;$dir/$blf&amp;quot;;&lt;br /&gt;
        my $target = &amp;quot;$destination/$final&amp;quot;;&lt;br /&gt;
        print &amp;quot;move $docs -&amp;gt; $target\n&amp;quot;;&lt;br /&gt;
        File::Copy::Recursive::rcopy($docs, $target);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
... This should copy &amp;lt;code&amp;gt;disk0/00/00/02/42/01/something.pdf&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;242/01/something.pdf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now remove the whole &amp;lt;code&amp;gt;disk0&amp;lt;/code&amp;gt; tree&lt;br /&gt;
&lt;br /&gt;
    rm -rf disk0&lt;br /&gt;
&lt;br /&gt;
=== Tidy up leading 0's ===&lt;br /&gt;
&lt;br /&gt;
In the abstract pages, the URLs are &amp;lt;code&amp;gt;242/1/something.pdf&amp;lt;/code&amp;gt;, so we need to delete all the leading 0's:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
use File::Slurp;&lt;br /&gt;
&lt;br /&gt;
my $root = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @tlfs = grep { /^\d/ &amp;amp;&amp;amp; -d &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $tlf (@tlfs) {&lt;br /&gt;
    my $dir = &amp;quot;$root/$tlf&amp;quot;;&lt;br /&gt;
    opendir( my $dh, $dir) || die &amp;quot;can't open $dir\n&amp;quot;;&lt;br /&gt;
    my @blfs = grep { /^\d/ &amp;amp;&amp;amp; -r &amp;quot;$dir/$_&amp;quot; } readdir($dh);&lt;br /&gt;
    close $dh;&lt;br /&gt;
    foreach my $blf (@blfs) {&lt;br /&gt;
        my $old = &amp;quot;$dir/$blf&amp;quot;;&lt;br /&gt;
        my $fn = $blf + 0;&lt;br /&gt;
        my $new = &amp;quot;$dir/$fn&amp;quot;;&lt;br /&gt;
        rename $old, $new;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Deal with all those Absolute URLs ==&lt;br /&gt;
&lt;br /&gt;
In a significant number of pages, &amp;lt;code&amp;gt;href&amp;lt;/code&amp;gt;s are ''absolute'', so need to be made relative. This snippet will fix that:&lt;br /&gt;
&lt;br /&gt;
   find . -type f -exec sed -i 's_http://my.repo/_/_g' {} +&lt;br /&gt;
&lt;br /&gt;
== Missing stylesheet &amp;amp; images ==&lt;br /&gt;
&lt;br /&gt;
These will be under &amp;lt;code&amp;gt;archives/&amp;lt;ARCHIVEID&amp;gt;/html/en/style&amp;lt;/code&amp;gt; on your EPrints server - copy the whole &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; across to your local &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
== Unwanted links to dynamic content ==&lt;br /&gt;
&lt;br /&gt;
Things like &amp;lt;code&amp;gt;seaching&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RSS feeds&amp;lt;/code&amp;gt; need to be removed from all web pages. Try:&lt;br /&gt;
&lt;br /&gt;
    find . -type f -exec sed -i '/rel=&amp;quot;alternate&amp;quot;\|rel=&amp;quot;Search&amp;quot;\|search\/simple\|ep_search_feed/d' {} +&lt;br /&gt;
&lt;br /&gt;
The some of the abstract pages will have the '''Preview''' link - that needs to go:&lt;br /&gt;
&lt;br /&gt;
    find . -name '*.html' -exec sed -r -i 's/(\s\|\s)?&amp;lt;a[^&amp;gt;]+&amp;gt;Preview&amp;lt;\/a&amp;gt;//' {} +&lt;br /&gt;
&lt;br /&gt;
The abstract pages will also list the local Persistent URI - which goes to a URL that's not supported - that also needs to go:&lt;br /&gt;
&lt;br /&gt;
    find . -name '*.html' -exec perl -p -i -e 's/&amp;lt;tr&amp;gt;&amp;lt;th align=&amp;quot;right&amp;quot;&amp;gt;URI:&amp;lt;\/th&amp;gt; &amp;lt;td valign=&amp;quot;top&amp;quot;&amp;gt;.*?&amp;lt;\/td&amp;gt;&amp;lt;\/tr&amp;gt;//' {} +&lt;br /&gt;
&lt;br /&gt;
You may have '''export''' options for some of your browse pages - they won't work:&lt;br /&gt;
&lt;br /&gt;
    find view/ -name '*.html' -exec perl -p -i -e '$/=undef;s/&amp;lt;form\b[^&amp;gt;]*&amp;gt;.*?&amp;lt;\/form&amp;gt;//s' {} +&lt;br /&gt;
&lt;br /&gt;
No point in having anything to suggest logins may work - so get rid of all the &amp;quot;Actions&amp;quot; sections:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    find . -name '*.html' -exec perl -p -i -e 's/&amp;lt;h3&amp;gt;Actions \(login required\)&amp;lt;\/h3&amp;gt;.*?&amp;lt;\/table&amp;gt;//' {} +&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(that should be most of it...)&lt;br /&gt;
&lt;br /&gt;
== Get the web server to serve pages ==&lt;br /&gt;
.... and now you can point a web server's &amp;quot;document root&amp;quot; at &amp;lt;code&amp;gt;/path/to/my.repo&amp;lt;/code&amp;gt; and it should all &amp;quot;just work&amp;quot;&lt;br /&gt;
(you may have file-permissions to deal with - but that's not difficult)&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Making_a_fossilised_repository&amp;diff=12361</id>
		<title>Making a fossilised repository</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Making_a_fossilised_repository&amp;diff=12361"/>
		<updated>2017-07-20T13:05:15Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Unwanted links to dynamic content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Howto]]&lt;br /&gt;
&lt;br /&gt;
(This work requires access to the database &amp;amp; original file-system)&lt;br /&gt;
&lt;br /&gt;
The rough plan is to pull all of the visible pages in the repository and make it available as a static copy - no dynamic stuff, no &lt;br /&gt;
&lt;br /&gt;
This process assumes you have access to the underlying database, and the file-store for the repo.&lt;br /&gt;
&lt;br /&gt;
Assume:&lt;br /&gt;
# you're working as a non-root user on a workstation&lt;br /&gt;
# your repo is accessable [to you] at http://my.repo/&lt;br /&gt;
# your web server will have a document-root of &amp;lt;code&amp;gt;~/www/my.repo&amp;lt;/code&amp;gt;&lt;br /&gt;
# you know how to set a document-root on your web server&lt;br /&gt;
# you'll have to do some tidying up (finding images, etc) yourself&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of the html pages ==&lt;br /&gt;
&lt;br /&gt;
   mkdir ~/www&lt;br /&gt;
   cd ~/www&lt;br /&gt;
   wget --local-encoding=UTF-8 --remote-encoding=UTF-8 --no-cache --mirror -nc -k http://my.repo/&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of all the abstract pages ==&lt;br /&gt;
You need check the database - the last eprintid in the eprints table is the number you need to count up to&lt;br /&gt;
&lt;br /&gt;
   cd my.repo&lt;br /&gt;
   for id in {1..12345} ; do wget --local-encoding=UTF-8 --remote-encoding=UTF-8 --no-cache -k http://my.repo/$id ; done&lt;br /&gt;
&lt;br /&gt;
[(a) note the lack of &amp;lt;code&amp;gt;--mirror&amp;lt;/code&amp;gt; option, abd (b) this *will* take quite a while..... but are you in a hurry?]&lt;br /&gt;
&lt;br /&gt;
This downloads each page into a file called $id, and we need to make that a directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
# run in ~/www/my.repo&lt;br /&gt;
use File::Slurp;&lt;br /&gt;
my $root = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @files = grep { /^\d/ &amp;amp;&amp;amp; -f &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $file (@files) {&lt;br /&gt;
    my $source = &amp;quot;$root/$file&amp;quot;;&lt;br /&gt;
    my $content = read_file($source, binmode =&amp;gt; ':utf8');&lt;br /&gt;
    unlink $source;&lt;br /&gt;
    mkdir $source;&lt;br /&gt;
    write_file( &amp;quot;$source/index.html&amp;quot;, {binmode =&amp;gt; ':utf8'}, $content ) ;&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of all the documents ==&lt;br /&gt;
&lt;br /&gt;
The problem here is that EPrints has a funny directory structure, which doesn't map to URLs, so we grab a copy, and then move them into the right place.&lt;br /&gt;
(Still in ~/www/my.repo/)&lt;br /&gt;
&lt;br /&gt;
    scp -r eprints_user@my.repo:/path/to/eprints/archives/opendepot/documents/disk0 .&lt;br /&gt;
&lt;br /&gt;
... will copy &amp;lt;code&amp;gt;disk0&amp;lt;/code&amp;gt; and all it's subdirectories into the current directory.&lt;br /&gt;
&lt;br /&gt;
=== Copy the documents into the right location in the web site ===&lt;br /&gt;
&lt;br /&gt;
We then use a move script to move each of the documents into the appropriate abstract directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
# you will need to tweek the root &amp;amp; number of nested loops if you have more data.&lt;br /&gt;
use File::Copy::Recursive;&lt;br /&gt;
&lt;br /&gt;
my $root = './00/00'; &lt;br /&gt;
my $destination = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @tlfs = grep { /^\w/ &amp;amp;&amp;amp; -r &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $tlf (@tlfs) {&lt;br /&gt;
    my $dir = &amp;quot;$root/$tlf&amp;quot;;&lt;br /&gt;
    opendir( my $dh, $dir) || die &amp;quot;can't open $dir\n&amp;quot;;&lt;br /&gt;
    my @blfs = grep { /^\w/ &amp;amp;&amp;amp; -r &amp;quot;$dir/$_&amp;quot; } readdir($dh);&lt;br /&gt;
    close $dh;&lt;br /&gt;
    foreach my $blf (@blfs) {&lt;br /&gt;
        my $combined = $tlf . $blf;&lt;br /&gt;
        my $final = $combined + 0;&lt;br /&gt;
        my $docs = &amp;quot;$dir/$blf&amp;quot;;&lt;br /&gt;
        my $target = &amp;quot;$destination/$final&amp;quot;;&lt;br /&gt;
        print &amp;quot;move $docs -&amp;gt; $target\n&amp;quot;;&lt;br /&gt;
        File::Copy::Recursive::rcopy($docs, $target);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
... This should copy &amp;lt;code&amp;gt;disk0/00/00/02/42/01/something.pdf&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;242/01/something.pdf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now remove the whole &amp;lt;code&amp;gt;disk0&amp;lt;/code&amp;gt; tree&lt;br /&gt;
&lt;br /&gt;
    rm -rf disk0&lt;br /&gt;
&lt;br /&gt;
=== Tidy up leading 0's ===&lt;br /&gt;
&lt;br /&gt;
In the abstract pages, the URLs are &amp;lt;code&amp;gt;242/1/something.pdf&amp;lt;/code&amp;gt;, so we need to delete all the leading 0's:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
use File::Slurp;&lt;br /&gt;
&lt;br /&gt;
my $root = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @tlfs = grep { /^\d/ &amp;amp;&amp;amp; -d &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $tlf (@tlfs) {&lt;br /&gt;
    my $dir = &amp;quot;$root/$tlf&amp;quot;;&lt;br /&gt;
    opendir( my $dh, $dir) || die &amp;quot;can't open $dir\n&amp;quot;;&lt;br /&gt;
    my @blfs = grep { /^\d/ &amp;amp;&amp;amp; -r &amp;quot;$dir/$_&amp;quot; } readdir($dh);&lt;br /&gt;
    close $dh;&lt;br /&gt;
    foreach my $blf (@blfs) {&lt;br /&gt;
        my $old = &amp;quot;$dir/$blf&amp;quot;;&lt;br /&gt;
        my $fn = $blf + 0;&lt;br /&gt;
        my $new = &amp;quot;$dir/$fn&amp;quot;;&lt;br /&gt;
        rename $old, $new;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Deal with all those Absolute URLs ==&lt;br /&gt;
&lt;br /&gt;
In a significant number of pages, &amp;lt;code&amp;gt;href&amp;lt;/code&amp;gt;s are ''absolute'', so need to be made relative. This snippet will fix that:&lt;br /&gt;
&lt;br /&gt;
   find . -type f -exec sed -i 's_http://my.repo/_/_g' {} +&lt;br /&gt;
&lt;br /&gt;
== Missing stylesheet &amp;amp; images ==&lt;br /&gt;
&lt;br /&gt;
These will be under &amp;lt;code&amp;gt;archives/&amp;lt;ARCHIVEID&amp;gt;/html/en/style&amp;lt;/code&amp;gt; on your EPrints server - copy the whole &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; across to your local &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
== Unwanted links to dynamic content ==&lt;br /&gt;
&lt;br /&gt;
Things like &amp;lt;code&amp;gt;seaching&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RSS feeds&amp;lt;/code&amp;gt; need to be removed from all web pages. Try:&lt;br /&gt;
&lt;br /&gt;
    find . -type f -exec sed -i '/rel=&amp;quot;alternate&amp;quot;\|rel=&amp;quot;Search&amp;quot;\|search\/simple\|ep_search_feed/d' {} +&lt;br /&gt;
&lt;br /&gt;
The some of the abstract pages will have the '''Preview''' link - that needs to go:&lt;br /&gt;
&lt;br /&gt;
    find . -name '*.html' -exec sed -r -i 's/(\s\|\s)?&amp;lt;a[^&amp;gt;]+&amp;gt;Preview&amp;lt;\/a&amp;gt;//' {} +&lt;br /&gt;
&lt;br /&gt;
The abstract pages will also list the local Persistent URI - which goes to a URL that's not supported - that also needs to go:&lt;br /&gt;
&lt;br /&gt;
    find . -name '*.html' -exec perl -p -i -e 's/&amp;lt;tr&amp;gt;&amp;lt;th align=&amp;quot;right&amp;quot;&amp;gt;URI:&amp;lt;\/th&amp;gt; &amp;lt;td valign=&amp;quot;top&amp;quot;&amp;gt;.*?&amp;lt;\/td&amp;gt;&amp;lt;\/tr&amp;gt;//' {} +&lt;br /&gt;
&lt;br /&gt;
You may have '''export''' options for some of your browse pages - they won't work:&lt;br /&gt;
&lt;br /&gt;
    find view/ -name '*.html' -exec perl -p -i -e '$/=undef;s/&amp;lt;form\b[^&amp;gt;]*&amp;gt;.*?&amp;lt;\/form&amp;gt;//s' {} +&lt;br /&gt;
&lt;br /&gt;
No point in having anything to suggest logins may work - so get rid of all the &amp;quot;Actions&amp;quot; sections:&lt;br /&gt;
&lt;br /&gt;
    find . -name '*.html' -exec perl -p -i -e 's/&amp;lt;h3&amp;gt;Actions \(login required\)&amp;lt;\/h3&amp;gt;.*?&amp;lt;\/table&amp;gt;//' {} +&lt;br /&gt;
&lt;br /&gt;
== Get the web server to serve pages ==&lt;br /&gt;
.... and now you can point a web server's &amp;quot;document root&amp;quot; at &amp;lt;code&amp;gt;/path/to/my.repo&amp;lt;/code&amp;gt; and it should all &amp;quot;just work&amp;quot;&lt;br /&gt;
(you may have file-permissions to deal with - but that's not difficult)&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Making_a_fossilised_repository&amp;diff=12360</id>
		<title>Making a fossilised repository</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Making_a_fossilised_repository&amp;diff=12360"/>
		<updated>2017-07-20T08:37:49Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Get the web server to serve pages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Howto]]&lt;br /&gt;
&lt;br /&gt;
(This work requires access to the database &amp;amp; original file-system)&lt;br /&gt;
&lt;br /&gt;
The rough plan is to pull all of the visible pages in the repository and make it available as a static copy - no dynamic stuff, no &lt;br /&gt;
&lt;br /&gt;
This process assumes you have access to the underlying database, and the file-store for the repo.&lt;br /&gt;
&lt;br /&gt;
Assume:&lt;br /&gt;
# you're working as a non-root user on a workstation&lt;br /&gt;
# your repo is accessable [to you] at http://my.repo/&lt;br /&gt;
# your web server will have a document-root of &amp;lt;code&amp;gt;~/www/my.repo&amp;lt;/code&amp;gt;&lt;br /&gt;
# you know how to set a document-root on your web server&lt;br /&gt;
# you'll have to do some tidying up (finding images, etc) yourself&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of the html pages ==&lt;br /&gt;
&lt;br /&gt;
   mkdir ~/www&lt;br /&gt;
   cd ~/www&lt;br /&gt;
   wget --local-encoding=UTF-8 --remote-encoding=UTF-8 --no-cache --mirror -nc -k http://my.repo/&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of all the abstract pages ==&lt;br /&gt;
You need check the database - the last eprintid in the eprints table is the number you need to count up to&lt;br /&gt;
&lt;br /&gt;
   cd my.repo&lt;br /&gt;
   for id in {1..12345} ; do wget --local-encoding=UTF-8 --remote-encoding=UTF-8 --no-cache -k http://my.repo/$id ; done&lt;br /&gt;
&lt;br /&gt;
[(a) note the lack of &amp;lt;code&amp;gt;--mirror&amp;lt;/code&amp;gt; option, abd (b) this *will* take quite a while..... but are you in a hurry?]&lt;br /&gt;
&lt;br /&gt;
This downloads each page into a file called $id, and we need to make that a directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
# run in ~/www/my.repo&lt;br /&gt;
use File::Slurp;&lt;br /&gt;
my $root = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @files = grep { /^\d/ &amp;amp;&amp;amp; -f &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $file (@files) {&lt;br /&gt;
    my $source = &amp;quot;$root/$file&amp;quot;;&lt;br /&gt;
    my $content = read_file($source, binmode =&amp;gt; ':utf8');&lt;br /&gt;
    unlink $source;&lt;br /&gt;
    mkdir $source;&lt;br /&gt;
    write_file( &amp;quot;$source/index.html&amp;quot;, {binmode =&amp;gt; ':utf8'}, $content ) ;&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of all the documents ==&lt;br /&gt;
&lt;br /&gt;
The problem here is that EPrints has a funny directory structure, which doesn't map to URLs, so we grab a copy, and then move them into the right place.&lt;br /&gt;
(Still in ~/www/my.repo/)&lt;br /&gt;
&lt;br /&gt;
    scp -r eprints_user@my.repo:/path/to/eprints/archives/opendepot/documents/disk0 .&lt;br /&gt;
&lt;br /&gt;
... will copy &amp;lt;code&amp;gt;disk0&amp;lt;/code&amp;gt; and all it's subdirectories into the current directory.&lt;br /&gt;
&lt;br /&gt;
=== Copy the documents into the right location in the web site ===&lt;br /&gt;
&lt;br /&gt;
We then use a move script to move each of the documents into the appropriate abstract directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
# you will need to tweek the root &amp;amp; number of nested loops if you have more data.&lt;br /&gt;
use File::Copy::Recursive;&lt;br /&gt;
&lt;br /&gt;
my $root = './00/00'; &lt;br /&gt;
my $destination = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @tlfs = grep { /^\w/ &amp;amp;&amp;amp; -r &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $tlf (@tlfs) {&lt;br /&gt;
    my $dir = &amp;quot;$root/$tlf&amp;quot;;&lt;br /&gt;
    opendir( my $dh, $dir) || die &amp;quot;can't open $dir\n&amp;quot;;&lt;br /&gt;
    my @blfs = grep { /^\w/ &amp;amp;&amp;amp; -r &amp;quot;$dir/$_&amp;quot; } readdir($dh);&lt;br /&gt;
    close $dh;&lt;br /&gt;
    foreach my $blf (@blfs) {&lt;br /&gt;
        my $combined = $tlf . $blf;&lt;br /&gt;
        my $final = $combined + 0;&lt;br /&gt;
        my $docs = &amp;quot;$dir/$blf&amp;quot;;&lt;br /&gt;
        my $target = &amp;quot;$destination/$final&amp;quot;;&lt;br /&gt;
        print &amp;quot;move $docs -&amp;gt; $target\n&amp;quot;;&lt;br /&gt;
        File::Copy::Recursive::rcopy($docs, $target);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
... This should copy &amp;lt;code&amp;gt;disk0/00/00/02/42/01/something.pdf&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;242/01/something.pdf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now remove the whole &amp;lt;code&amp;gt;disk0&amp;lt;/code&amp;gt; tree&lt;br /&gt;
&lt;br /&gt;
    rm -rf disk0&lt;br /&gt;
&lt;br /&gt;
=== Tidy up leading 0's ===&lt;br /&gt;
&lt;br /&gt;
In the abstract pages, the URLs are &amp;lt;code&amp;gt;242/1/something.pdf&amp;lt;/code&amp;gt;, so we need to delete all the leading 0's:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
use File::Slurp;&lt;br /&gt;
&lt;br /&gt;
my $root = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @tlfs = grep { /^\d/ &amp;amp;&amp;amp; -d &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $tlf (@tlfs) {&lt;br /&gt;
    my $dir = &amp;quot;$root/$tlf&amp;quot;;&lt;br /&gt;
    opendir( my $dh, $dir) || die &amp;quot;can't open $dir\n&amp;quot;;&lt;br /&gt;
    my @blfs = grep { /^\d/ &amp;amp;&amp;amp; -r &amp;quot;$dir/$_&amp;quot; } readdir($dh);&lt;br /&gt;
    close $dh;&lt;br /&gt;
    foreach my $blf (@blfs) {&lt;br /&gt;
        my $old = &amp;quot;$dir/$blf&amp;quot;;&lt;br /&gt;
        my $fn = $blf + 0;&lt;br /&gt;
        my $new = &amp;quot;$dir/$fn&amp;quot;;&lt;br /&gt;
        rename $old, $new;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Deal with all those Absolute URLs ==&lt;br /&gt;
&lt;br /&gt;
In a significant number of pages, &amp;lt;code&amp;gt;href&amp;lt;/code&amp;gt;s are ''absolute'', so need to be made relative. This snippet will fix that:&lt;br /&gt;
&lt;br /&gt;
   find . -type f -exec sed -i 's_http://my.repo/_/_g' {} +&lt;br /&gt;
&lt;br /&gt;
== Missing stylesheet &amp;amp; images ==&lt;br /&gt;
&lt;br /&gt;
These will be under &amp;lt;code&amp;gt;archives/&amp;lt;ARCHIVEID&amp;gt;/html/en/style&amp;lt;/code&amp;gt; on your EPrints server - copy the whole &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; across to your local &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
== Unwanted links to dynamic content ==&lt;br /&gt;
&lt;br /&gt;
Things like &amp;lt;code&amp;gt;seaching&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RSS feeds&amp;lt;/code&amp;gt; need to be removed from all web pages. Try:&lt;br /&gt;
&lt;br /&gt;
    find . -type f -exec sed -i '/rel=&amp;quot;alternate&amp;quot;\|rel=&amp;quot;Search&amp;quot;\|search\/simple\|ep_search_feed/d' {} +&lt;br /&gt;
&lt;br /&gt;
== Get the web server to serve pages ==&lt;br /&gt;
.... and now you can point a web server's &amp;quot;document root&amp;quot; at &amp;lt;code&amp;gt;/path/to/my.repo&amp;lt;/code&amp;gt; and it should all &amp;quot;just work&amp;quot;&lt;br /&gt;
(you may have file-permissions to deal with - but that's not difficult)&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Making_a_fossilised_repository&amp;diff=12359</id>
		<title>Making a fossilised repository</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Making_a_fossilised_repository&amp;diff=12359"/>
		<updated>2017-07-20T08:37:26Z</updated>

		<summary type="html">&lt;p&gt;Kiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Howto]]&lt;br /&gt;
&lt;br /&gt;
(This work requires access to the database &amp;amp; original file-system)&lt;br /&gt;
&lt;br /&gt;
The rough plan is to pull all of the visible pages in the repository and make it available as a static copy - no dynamic stuff, no &lt;br /&gt;
&lt;br /&gt;
This process assumes you have access to the underlying database, and the file-store for the repo.&lt;br /&gt;
&lt;br /&gt;
Assume:&lt;br /&gt;
# you're working as a non-root user on a workstation&lt;br /&gt;
# your repo is accessable [to you] at http://my.repo/&lt;br /&gt;
# your web server will have a document-root of &amp;lt;code&amp;gt;~/www/my.repo&amp;lt;/code&amp;gt;&lt;br /&gt;
# you know how to set a document-root on your web server&lt;br /&gt;
# you'll have to do some tidying up (finding images, etc) yourself&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of the html pages ==&lt;br /&gt;
&lt;br /&gt;
   mkdir ~/www&lt;br /&gt;
   cd ~/www&lt;br /&gt;
   wget --local-encoding=UTF-8 --remote-encoding=UTF-8 --no-cache --mirror -nc -k http://my.repo/&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of all the abstract pages ==&lt;br /&gt;
You need check the database - the last eprintid in the eprints table is the number you need to count up to&lt;br /&gt;
&lt;br /&gt;
   cd my.repo&lt;br /&gt;
   for id in {1..12345} ; do wget --local-encoding=UTF-8 --remote-encoding=UTF-8 --no-cache -k http://my.repo/$id ; done&lt;br /&gt;
&lt;br /&gt;
[(a) note the lack of &amp;lt;code&amp;gt;--mirror&amp;lt;/code&amp;gt; option, abd (b) this *will* take quite a while..... but are you in a hurry?]&lt;br /&gt;
&lt;br /&gt;
This downloads each page into a file called $id, and we need to make that a directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
# run in ~/www/my.repo&lt;br /&gt;
use File::Slurp;&lt;br /&gt;
my $root = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @files = grep { /^\d/ &amp;amp;&amp;amp; -f &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $file (@files) {&lt;br /&gt;
    my $source = &amp;quot;$root/$file&amp;quot;;&lt;br /&gt;
    my $content = read_file($source, binmode =&amp;gt; ':utf8');&lt;br /&gt;
    unlink $source;&lt;br /&gt;
    mkdir $source;&lt;br /&gt;
    write_file( &amp;quot;$source/index.html&amp;quot;, {binmode =&amp;gt; ':utf8'}, $content ) ;&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of all the documents ==&lt;br /&gt;
&lt;br /&gt;
The problem here is that EPrints has a funny directory structure, which doesn't map to URLs, so we grab a copy, and then move them into the right place.&lt;br /&gt;
(Still in ~/www/my.repo/)&lt;br /&gt;
&lt;br /&gt;
    scp -r eprints_user@my.repo:/path/to/eprints/archives/opendepot/documents/disk0 .&lt;br /&gt;
&lt;br /&gt;
... will copy &amp;lt;code&amp;gt;disk0&amp;lt;/code&amp;gt; and all it's subdirectories into the current directory.&lt;br /&gt;
&lt;br /&gt;
=== Copy the documents into the right location in the web site ===&lt;br /&gt;
&lt;br /&gt;
We then use a move script to move each of the documents into the appropriate abstract directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
# you will need to tweek the root &amp;amp; number of nested loops if you have more data.&lt;br /&gt;
use File::Copy::Recursive;&lt;br /&gt;
&lt;br /&gt;
my $root = './00/00'; &lt;br /&gt;
my $destination = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @tlfs = grep { /^\w/ &amp;amp;&amp;amp; -r &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $tlf (@tlfs) {&lt;br /&gt;
    my $dir = &amp;quot;$root/$tlf&amp;quot;;&lt;br /&gt;
    opendir( my $dh, $dir) || die &amp;quot;can't open $dir\n&amp;quot;;&lt;br /&gt;
    my @blfs = grep { /^\w/ &amp;amp;&amp;amp; -r &amp;quot;$dir/$_&amp;quot; } readdir($dh);&lt;br /&gt;
    close $dh;&lt;br /&gt;
    foreach my $blf (@blfs) {&lt;br /&gt;
        my $combined = $tlf . $blf;&lt;br /&gt;
        my $final = $combined + 0;&lt;br /&gt;
        my $docs = &amp;quot;$dir/$blf&amp;quot;;&lt;br /&gt;
        my $target = &amp;quot;$destination/$final&amp;quot;;&lt;br /&gt;
        print &amp;quot;move $docs -&amp;gt; $target\n&amp;quot;;&lt;br /&gt;
        File::Copy::Recursive::rcopy($docs, $target);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
... This should copy &amp;lt;code&amp;gt;disk0/00/00/02/42/01/something.pdf&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;242/01/something.pdf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now remove the whole &amp;lt;code&amp;gt;disk0&amp;lt;/code&amp;gt; tree&lt;br /&gt;
&lt;br /&gt;
    rm -rf disk0&lt;br /&gt;
&lt;br /&gt;
=== Tidy up leading 0's ===&lt;br /&gt;
&lt;br /&gt;
In the abstract pages, the URLs are &amp;lt;code&amp;gt;242/1/something.pdf&amp;lt;/code&amp;gt;, so we need to delete all the leading 0's:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
use File::Slurp;&lt;br /&gt;
&lt;br /&gt;
my $root = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @tlfs = grep { /^\d/ &amp;amp;&amp;amp; -d &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $tlf (@tlfs) {&lt;br /&gt;
    my $dir = &amp;quot;$root/$tlf&amp;quot;;&lt;br /&gt;
    opendir( my $dh, $dir) || die &amp;quot;can't open $dir\n&amp;quot;;&lt;br /&gt;
    my @blfs = grep { /^\d/ &amp;amp;&amp;amp; -r &amp;quot;$dir/$_&amp;quot; } readdir($dh);&lt;br /&gt;
    close $dh;&lt;br /&gt;
    foreach my $blf (@blfs) {&lt;br /&gt;
        my $old = &amp;quot;$dir/$blf&amp;quot;;&lt;br /&gt;
        my $fn = $blf + 0;&lt;br /&gt;
        my $new = &amp;quot;$dir/$fn&amp;quot;;&lt;br /&gt;
        rename $old, $new;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Deal with all those Absolute URLs ==&lt;br /&gt;
&lt;br /&gt;
In a significant number of pages, &amp;lt;code&amp;gt;href&amp;lt;/code&amp;gt;s are ''absolute'', so need to be made relative. This snippet will fix that:&lt;br /&gt;
&lt;br /&gt;
   find . -type f -exec sed -i 's_http://my.repo/_/_g' {} +&lt;br /&gt;
&lt;br /&gt;
== Missing stylesheet &amp;amp; images ==&lt;br /&gt;
&lt;br /&gt;
These will be under &amp;lt;code&amp;gt;archives/&amp;lt;ARCHIVEID&amp;gt;/html/en/style&amp;lt;/code&amp;gt; on your EPrints server - copy the whole &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; across to your local &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; directory&lt;br /&gt;
&lt;br /&gt;
== Unwanted links to dynamic content ==&lt;br /&gt;
&lt;br /&gt;
Things like &amp;lt;code&amp;gt;seaching&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RSS feeds&amp;lt;/code&amp;gt; need to be removed from all web pages. Try:&lt;br /&gt;
&lt;br /&gt;
    find . -type f -exec sed -i '/rel=&amp;quot;alternate&amp;quot;\|rel=&amp;quot;Search&amp;quot;\|search\/simple\|ep_search_feed/d' {} +&lt;br /&gt;
&lt;br /&gt;
== Get the web server to serve pages ==&lt;br /&gt;
.... and now you can point a web server's &amp;quot;document root&amp;quot; at &amp;lt;code&amp;gt;/path/to/my.repo&amp;lt;code&amp;gt; and it should all &amp;quot;just work&amp;quot;&lt;br /&gt;
(you may have file-permissions to deal with - but that's not difficult)&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Making_a_fossilised_repository&amp;diff=12358</id>
		<title>Making a fossilised repository</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Making_a_fossilised_repository&amp;diff=12358"/>
		<updated>2017-07-19T11:20:16Z</updated>

		<summary type="html">&lt;p&gt;Kiz: Created page with &amp;quot;Category:Howto  (This work requires access to the database &amp;amp; original file-system)  The rough plan is to pull all of the visible pages in the repository and make it availa...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Howto]]&lt;br /&gt;
&lt;br /&gt;
(This work requires access to the database &amp;amp; original file-system)&lt;br /&gt;
&lt;br /&gt;
The rough plan is to pull all of the visible pages in the repository and make it available as a static copy - no dynamic stuff, no &lt;br /&gt;
&lt;br /&gt;
This process assumes you have access to the underlying database, and the file-store for the repo.&lt;br /&gt;
&lt;br /&gt;
Assume:&lt;br /&gt;
# you're working as a non-root user on a workstation&lt;br /&gt;
# your repo is accessable [to you] at http://my.repo/&lt;br /&gt;
# your web server will have a document-root of ~/www/my.repo&lt;br /&gt;
# you know how to set a document-root on your web server&lt;br /&gt;
# you'll have to do some tidying up (finding images, etc) yourself&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of the html pages ==&lt;br /&gt;
&lt;br /&gt;
   mkdir ~/www&lt;br /&gt;
   cd ~/www&lt;br /&gt;
   wget --local-encoding=UTF-8 --remote-encoding=UTF-8 --no-cache --mirror -nc -k http://my.repo/&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of all the abstract pages ==&lt;br /&gt;
You need check the database - the last eprintid in the eprints table is the number you need to count up to&lt;br /&gt;
&lt;br /&gt;
   cd my.repo&lt;br /&gt;
   for id in {1..12345} ; do wget --local-encoding=UTF-8 --remote-encoding=UTF-8 --no-cache -k http://my.repo/$id ; done&lt;br /&gt;
&lt;br /&gt;
[(a) note the lack -f --mirror option, abd (b) this *will* take quite a while..... but are you in a hurry?]&lt;br /&gt;
&lt;br /&gt;
This downloads each page into a file called $id, and we need to make that a directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
# run in ~/www/my.repo&lt;br /&gt;
use File::Slurp;&lt;br /&gt;
my $root = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @files = grep { /^\d/ &amp;amp;&amp;amp; -f &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $file (@files) {&lt;br /&gt;
    my $source = &amp;quot;$root/$file&amp;quot;;&lt;br /&gt;
    my $content = read_file($source, binmode =&amp;gt; ':utf8');&lt;br /&gt;
    unlink $source;&lt;br /&gt;
    mkdir $source;&lt;br /&gt;
    write_file( &amp;quot;$source/index.html&amp;quot;, {binmode =&amp;gt; ':utf8'}, $content ) ;&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grab a copy of all the documents ==&lt;br /&gt;
&lt;br /&gt;
The problem here is that EPrints has a funny directory structure, which doesn't map to URLs, so we grab a copy, and then move them into the right place.&lt;br /&gt;
(Still in ~/www/my.repo/)&lt;br /&gt;
&lt;br /&gt;
    scp -r eprints_user@my.repo:/path/to/eprints/archives/opendepot/documents/disk0 .&lt;br /&gt;
&lt;br /&gt;
... will copy 'disk0' and all it's subdirectories into the current directory.&lt;br /&gt;
&lt;br /&gt;
=== Copy the documents into the right location in the web site ===&lt;br /&gt;
&lt;br /&gt;
We then use a move script to move each of the documents into the appropriate abstract directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
# you will need to tweek the root &amp;amp; number oif nested loops if you have more data.&lt;br /&gt;
use File::Copy::Recursive;&lt;br /&gt;
&lt;br /&gt;
my $root = './00/00'; &lt;br /&gt;
my $destination = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @tlfs = grep { /^\w/ &amp;amp;&amp;amp; -r &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $tlf (@tlfs) {&lt;br /&gt;
    my $dir = &amp;quot;$root/$tlf&amp;quot;;&lt;br /&gt;
    opendir( my $dh, $dir) || die &amp;quot;can't open $dir\n&amp;quot;;&lt;br /&gt;
    my @blfs = grep { /^\w/ &amp;amp;&amp;amp; -r &amp;quot;$dir/$_&amp;quot; } readdir($dh);&lt;br /&gt;
    close $dh;&lt;br /&gt;
    foreach my $blf (@blfs) {&lt;br /&gt;
        my $combined = $tlf . $blf;&lt;br /&gt;
        my $final = $combined + 0;&lt;br /&gt;
        my $docs = &amp;quot;$dir/$blf&amp;quot;;&lt;br /&gt;
        my $target = &amp;quot;$destination/$final&amp;quot;;&lt;br /&gt;
        print &amp;quot;move $docs -&amp;gt; $target\n&amp;quot;;&lt;br /&gt;
        File::Copy::Recursive::rcopy($docs, $target);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
... This should copy disk0/00/00/02/42/01/something.pdf to 242/01/something.pdf&lt;br /&gt;
&lt;br /&gt;
You can now remove the whole disk0 tree&lt;br /&gt;
&lt;br /&gt;
    rm -rf disk0&lt;br /&gt;
&lt;br /&gt;
=== Tidy up leading 0's ===&lt;br /&gt;
&lt;br /&gt;
In the abstract pages, the URLs are 242/1/something.pdf, so we need to delete all the leading 0's:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- perl code ----&lt;br /&gt;
use File::Slurp;&lt;br /&gt;
&lt;br /&gt;
my $root = '.';&lt;br /&gt;
&lt;br /&gt;
opendir( my $dh, $root) || die &amp;quot;can't open doc root\n&amp;quot;;&lt;br /&gt;
my @tlfs = grep { /^\d/ &amp;amp;&amp;amp; -d &amp;quot;$root/$_&amp;quot; } readdir($dh);&lt;br /&gt;
close $dh;&lt;br /&gt;
&lt;br /&gt;
foreach my $tlf (@tlfs) {&lt;br /&gt;
    my $dir = &amp;quot;$root/$tlf&amp;quot;;&lt;br /&gt;
    opendir( my $dh, $dir) || die &amp;quot;can't open $dir\n&amp;quot;;&lt;br /&gt;
    my @blfs = grep { /^\d/ &amp;amp;&amp;amp; -r &amp;quot;$dir/$_&amp;quot; } readdir($dh);&lt;br /&gt;
    close $dh;&lt;br /&gt;
    foreach my $blf (@blfs) {&lt;br /&gt;
        my $old = &amp;quot;$dir/$blf&amp;quot;;&lt;br /&gt;
        my $fn = $blf + 0;&lt;br /&gt;
        my $new = &amp;quot;$dir/$fn&amp;quot;;&lt;br /&gt;
        rename $old, $new;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
---- perl code ----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Deal with all those Absolute URLs ==&lt;br /&gt;
&lt;br /&gt;
In a significant number of pages, '''href'''s are ''absolute'', so need to be made relative. This snippet will fix that:&lt;br /&gt;
&lt;br /&gt;
   find . -type f -exec sed -i 's_http://my.repo/_/_g' {} +&lt;br /&gt;
&lt;br /&gt;
== Get the web server to serve pages ==&lt;br /&gt;
.... and now you can point a web server's &amp;quot;document root&amp;quot; at /path/to/my.repo and it should all &amp;quot;just work&amp;quot;&lt;br /&gt;
(you may have file-permissions to deal with - but that's not difficult)&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Views.pl&amp;diff=11132</id>
		<title>Views.pl</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Views.pl&amp;diff=11132"/>
		<updated>2015-03-06T15:43:25Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Browse Views]]&lt;br /&gt;
[[Category:Documentation Needed]]&lt;br /&gt;
== Views ==&lt;br /&gt;
Conceptually a ''view'' is a browsable list of eprints split into ''menus'' and a ''list''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-color:black; border-style:solid; border-width:1px 1px 0 1px; margin:0; padding:0; text-align:center; font-size:10px&amp;quot; |Menu1&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px; text-align: left; margin:0; padding:0; font-size:10px&amp;quot;| &amp;amp;nbsp; Item1_1 ------&lt;br /&gt;
| style=&amp;quot;font-size:10px&amp;quot;|---&amp;gt;&lt;br /&gt;
| style=&amp;quot;border-color:black; border-style:solid; border-width:1px 1px 0 1px; margin:0; padding:0; text-align:center; font-size:10px&amp;quot;|Menu2&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px; text-align: left; font-size:10px&amp;quot;| &amp;amp;nbsp; Item1_2 &lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px; text-align: left; margin:0; padding:0; font-size:10px&amp;quot;| &amp;amp;nbsp; Item2_1 ----- &lt;br /&gt;
|style=&amp;quot;font-size:10px&amp;quot;|---&amp;gt;&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:1px 1px 0 1px; margin:0; padding:0; text-align:center; font-size:10px&amp;quot;| &amp;amp;nbsp; &amp;amp;nbsp; LIST &amp;amp;nbsp; &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px 1px 1px; margin:0; padding:0; text-align:left; font-size:10px&amp;quot;| &amp;amp;nbsp; ....&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px; text-align: left; margin:0; padding:0; font-size:10px&amp;quot;| &amp;amp;nbsp; Item2_2&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px 1px 1px; margin:0; padding:0; text-align:left; font-size:10px&amp;quot;| &amp;amp;nbsp; ....&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px 1px 1px; margin:0; padding:0; text-align:left; font-size:10px&amp;quot;| &amp;amp;nbsp; ....&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a ''menu'' values of one (or more) fields are listed, and a link points to the collection of all items with that particular value in that field.&lt;br /&gt;
&lt;br /&gt;
The ''list'' contains the final list of eprints with field values as determined by the menus above it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Options available for the views config ==&lt;br /&gt;
This link is an [http://wiki.eprints.org/w/Adding_new_views 'How to' about views] with examples.&lt;br /&gt;
&lt;br /&gt;
The general form of views definition is&lt;br /&gt;
&lt;br /&gt;
  $c-&amp;gt;{browse_views} = [&lt;br /&gt;
    { &amp;lt;first view definition&amp;gt; },&lt;br /&gt;
    { &amp;lt;second view definition&amp;gt; },&lt;br /&gt;
    ...&lt;br /&gt;
    { &amp;lt;last view definition&amp;gt; },&lt;br /&gt;
  ];&lt;br /&gt;
&lt;br /&gt;
(be careful about commas and semicolons). The order of the view definitions determines the order in which these will appear in the &amp;lt;nowiki&amp;gt;http://repoid/view/&amp;lt;/nowiki&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
Each view definition is a collection of attributes, given as&lt;br /&gt;
&lt;br /&gt;
    attribute1 =&amp;gt; value1,&lt;br /&gt;
    attribute2 =&amp;gt; value2,&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
(again, the ''value'' should end by a comma). The ''value'' can be&lt;br /&gt;
*''integer''&lt;br /&gt;
*''string'' enclosed by quotation marks (&amp;quot;) or by apostrophes (')&lt;br /&gt;
*''array'' which starts by a square bracket [ followed by the elements of the array (separated by commas) and closed by ] or &lt;br /&gt;
*''hash'' which is a list of &amp;quot;attribute =&amp;gt; value&amp;quot; pairs enclosed by curly brackets { and }.&lt;br /&gt;
Thus the browse_views definition is an array of hashes.&lt;br /&gt;
&lt;br /&gt;
Attributes marked by &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt; are ''view'' attributes and are in the view definition; attributes marked by &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt; are ''menu'' attributes and should be used only in [[#Menu options|menu definitions]].&lt;br /&gt;
&lt;br /&gt;
==Basic options==&lt;br /&gt;
&lt;br /&gt;
Options in the first category are ''view'' options.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| id &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
| (mandatory) String, this is the ID by which you will refer to this view, and also the name of the top directory in &amp;lt;nowiki&amp;gt;http://repoid/view/&amp;lt;/nowiki&amp;gt;. This is the value of the ''browse_link'' attribute in [[eprint_fields.pl]]. Example:&lt;br /&gt;
&lt;br /&gt;
    id =&amp;gt; 'divisions',&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|fields &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt; &lt;br /&gt;
|(deprecated) This attribute describes the field(s) by which the view is built. It has been replaced by the more general [[#Menu options|menus]] attribute.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideempty &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
allow_null &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
new_column_at &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
render_menu &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|These define the default values of the same attributes in all [[#Menu options|menus]]. I.e, if not defined otherwise there, they take this as the default value in this view. &amp;quot;Hideempty&amp;quot; is also used when rendering the [[#View list options|view]] list.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|menus &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|An array of ''[[#Menu options|menu descriptions]]''. Each ''menu'' is a refinement of the previous ones, and last menu points to the [[#View list options|view list(s)]]. In each menu, as minimum, you should give the field(s) which are used to define entries at that level. The menus definition looks like&lt;br /&gt;
  menus =&amp;gt; [&lt;br /&gt;
     { &amp;lt;first menu definition&amp;gt; },&lt;br /&gt;
     { &amp;lt;second level menu&amp;gt; },&lt;br /&gt;
     { &amp;lt;last level&amp;gt; },&lt;br /&gt;
  ],&lt;br /&gt;
You must have at least one menu level.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|template &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Define an alternate template for all pages in this view. The template page should be a proper xml file in the &amp;lt;tt&amp;gt;repoid/cfg/lang/&amp;lt;langid&amp;gt;/templates/&amp;lt;/tt&amp;gt; directory. The best way is to copy the default.xml file and edit it according to taste. &lt;br /&gt;
  template =&amp;gt; 'view_template',&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|nolink &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|When this is set to 1 by adding&lt;br /&gt;
  nolink =&amp;gt; 1,&lt;br /&gt;
then this view won't appear in the outmost &amp;lt;nowiki&amp;gt;http://repoid/view/&amp;lt;/nowiki&amp;gt; browse page.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| max_menu_age&amp;amp;nbsp;&amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
| Defaults to 86400 (one day in seconds). If the menus in this view has been generated more than that many seconds ago, it is regenerated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===View list options===&lt;br /&gt;
These are the options which determine how the last list page in the menu chain should look like. They must be entered at the outmost ''view'' level. &lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|order &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|This defines how the items in the view list (at the lowest level) are ordered. The format is 'foo/-bar'. This means that the list will be sorted by 'foo' and then any equal 'foo' values will be reverse sorted by 'bar'. More than 2 fields can be specified. Example:&lt;br /&gt;
  order =&amp;gt; &amp;quot;-date/title&amp;quot;,&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideup &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Don't show the &amp;quot;up one level&amp;quot; link in the list page. You ''must'' set this attribute for each menu separately, it is not inherited.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideempty &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Do not list the empty (undefined) entry in the list. This property inherits to the menus.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|nocount &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|If set, the &amp;quot;Number of items&amp;quot; line at the top of the page is omitted.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|notimestamp &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|If set, the &amp;quot;This list was generated on&amp;quot; line at the bottom of the list is omitted.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|variations &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|An array of strings describing different rendering of the items at the ''list''. For datails see [[#Variations|variations]]. Example:&lt;br /&gt;
    variation =&amp;gt; [ &amp;quot;creators_name;first_letter&amp;quot;, &lt;br /&gt;
        &amp;quot;type&amp;quot;, &amp;quot;DEFAULT&amp;quot;, ],&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|layout &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Possible values are &lt;br /&gt;
*paragraph (default)&lt;br /&gt;
*orderedlist&lt;br /&gt;
*unorderedlist&lt;br /&gt;
Determines how items in the list (or sublist) is rendered. In the first case each item is a paragraph by itself. In the other cases items are rendered as an ordered (unordered) list.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|citation &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|The citation style defined in archives/&amp;lt;REPOID&amp;gt;/cfg/citations/eprint/ which is used to render each item. Example:&lt;br /&gt;
  citation =&amp;gt; 'screen',&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|max_list_age&amp;amp;nbsp;&amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Defaults to 86400 (one day in seconds). If the lists in this view were generated more than than many seconds ago, it is regenerated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Variations===&lt;br /&gt;
&lt;br /&gt;
Variations, if defined, determine how the final list is rendered. ''Variations'' is an array of strings, for example,&lt;br /&gt;
&lt;br /&gt;
 [ &amp;quot;creators_name;first_letter&amp;quot;,&lt;br /&gt;
   &amp;quot;type&amp;quot;,&lt;br /&gt;
   &amp;quot;DEFAULT&amp;quot;,&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
For each string in the list, a different rendering is produced, and you can switch from one to the other. The variation &amp;quot;DEFAULT&amp;quot; is the default one, it is always a good practice to include it in the list. If no variation is given, &amp;quot;DEFAULT&amp;quot; is used.&lt;br /&gt;
&lt;br /&gt;
A ''variation definition'' consists of a field name, followed by zero, one or more ''options'' after a semicolon. Options are separated by commas. An ''option'' is either a single attribute, or an attribute, an equal sign, and the value of the attribute. For example,&lt;br /&gt;
    &amp;quot;creators_name;truncate=4,hideup&amp;quot;&lt;br /&gt;
sets the attribute value &amp;quot;truncate&amp;quot; to 4, and &amp;quot;hideup&amp;quot; to 1 (or true).&lt;br /&gt;
&lt;br /&gt;
The following options are available. These options are ''part of the string'' defining the variation, and ''should not be entered'' as attributes.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|reverse&lt;br /&gt;
|Reverses the order in which the groupings are shown.  Default is the ordervalue for that field (usually alphanumeric).  Useful for dates as you may want the highest values first.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|filename&lt;br /&gt;
|Changes the filename of the view variation.  The default is the name of the metadata field used, so if two variations use the same metadata field with different options, this is needed.&lt;br /&gt;
 filename=different_filename&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|first_value&lt;br /&gt;
|If a field is multiple, only use the first value.  Otherwise each item will appear once for each value.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|first_initial&lt;br /&gt;
|If using a name, truncate the given name to the first initial.  This will make items like &amp;quot;Les Carr&amp;quot; and &amp;quot;Leslie Carr&amp;quot; appear together.  Note it will also make &amp;quot;John Smith&amp;quot; and &amp;quot;Jake Smith&amp;quot; appear together too, showing that you really never can win.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|first_letter&lt;br /&gt;
|The same as 'truncate=1'&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|truncate&lt;br /&gt;
|Use the first X characters of a value to group by.  truncate=4 may be useful for dates as it will group by the first four digits (the year) only.&lt;br /&gt;
 truncate=4&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|tags&lt;br /&gt;
|Useful for fields like keywords where values may be separated by commas or semi-colons.  The value is split on these two characters ( , and ; ) and a heading is created for each.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|cloud&lt;br /&gt;
|Creates a tag cloud.  Sets jump to 'plain', cloudmax to 200, cloudmin to 80 and no_separator, then resizes the jump-to links according to frequency of use.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|cloudmax&lt;br /&gt;
|The % size of the largest tag in a tag cloud.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|cloudmin&lt;br /&gt;
|The % size of the smallest tag in a tag cloud.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|jump&lt;br /&gt;
|Possible values are 'plain', 'default', and 'none'. Example:&lt;br /&gt;
  jump=plain&lt;br /&gt;
When set to 'plain' turns off the 'jump to' text before the list of subheading navigation links. When 'none', then the 'jump' part is not rendered.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|no_seperator (sic)&lt;br /&gt;
|Turns of the separator between each subheading navigation link (by default a vertical bar symbol).&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|string&lt;br /&gt;
|Uses values 'as is'.  No ordervalues, no phrases.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideup (since 3.1.1) &lt;br /&gt;
|Defaults to &amp;quot;0&amp;quot;. If set to &amp;quot;1&amp;quot; this hides the &amp;quot;up to parent&amp;quot; link (often you want to hide this on .include files)&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|render_fn&lt;br /&gt;
|Name of a function to render this groupings list of items. For an example, see views_render_items_example.pl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Menu options===&lt;br /&gt;
&lt;br /&gt;
These options can only be used in the '''menu definitions'''.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|fields  &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Obligatory, an array of field identifiers. Items in all fields are merged together. For example, to define a list of those those who are either authors or editors or both, use the definition&lt;br /&gt;
&lt;br /&gt;
    fields =&amp;gt; [ &amp;quot;creators_id&amp;quot;, &amp;quot;editors_id&amp;quot; ],&lt;br /&gt;
&lt;br /&gt;
Even if there is a single field, you must use square brackets, such as&lt;br /&gt;
&lt;br /&gt;
    fields =&amp;gt; [ &amp;quot;subjects&amp;quot; ],&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color: #662211; background-color:#ddffdc; border:1px solid black; padding:3px;&amp;quot;&amp;gt;'''Important!''' All fields must have the same type - i.e. you cannot mix titles and authors, say.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add extra rendering info to the field name, without the &amp;quot;render_&amp;quot; prefix. For example, to make a date have resolution year, you would write&lt;br /&gt;
&lt;br /&gt;
    fields =&amp;gt; [ &amp;quot;date;res=year&amp;quot; ],&lt;br /&gt;
&lt;br /&gt;
or, ordering authors by their ''given'' names rather than by their family names:&lt;br /&gt;
&lt;br /&gt;
    fields =&amp;gt; [ &amp;quot;creators_name;order=gf&amp;quot; ],&lt;br /&gt;
&lt;br /&gt;
You can add &amp;quot;;quiet&amp;quot; to the field name to force non-existing values to appear as empty space rather than the ugly &amp;quot;UNDEFINED&amp;quot; (see the allow_null property below). You can find the available rendering properties of different fields in the [[Metadata]] section.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|allow_null &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt; &lt;br /&gt;
|The ''undefined'' value among the possible values of the fields does not show up in the generated view. To allow the undefined value to appear as well, set&lt;br /&gt;
&lt;br /&gt;
  allow_null =&amp;gt; 1,&lt;br /&gt;
&lt;br /&gt;
Beware: the title of the undefined entries will be the ugly UNDEFINED. You might consider to use the &amp;quot;;quiet&amp;quot; rendering option for field names.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideempty &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|If a category is empty, don't show it as an entry. Default value: show all entries, even if they contain no entries. Used only in menus, not at the lower level (list).&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
    hideempty =&amp;gt; 1,&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|reverse_order &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|If set, then the ordering of items in this menu is reversed. Example:&lt;br /&gt;
&lt;br /&gt;
    reverse_order =&amp;gt; 1,&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|mode &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Possible values: ''[[#Sections|sections]]'' and ''default'' (default). When defined as ''sections'' then grouping can be defined by the following data:&lt;br /&gt;
* ''grouping_function'' (group by first character if not defined)&lt;br /&gt;
* ''group_sorting_function'' (how to sort members of a group)&lt;br /&gt;
* ''group_range_function''&lt;br /&gt;
* ''open_first_section'' the front page should show the first section&lt;br /&gt;
See [[#Sections|below]].&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideup &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|When set to 1, don't show the &amp;quot;move one level up&amp;quot; link at the top of the page.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|render_menu &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|The configuration parameter which renders this menu. This should be a string, and also you should define a routine with the same name. For example if you write&lt;br /&gt;
    render_menu =&amp;gt; 'render_view_menu_3col_boxes',&lt;br /&gt;
then this menu will be rendered by the routine which is defined in [[views_render_menu_example.pl]] as&lt;br /&gt;
  $c-&amp;gt;{render_view_menu_3col_boxes} = sub&lt;br /&gt;
  {&lt;br /&gt;
       ...&lt;br /&gt;
  }&lt;br /&gt;
See there for hints how to tweak your own routine.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|new_column_at &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Used in menus (not lists) and in default mode. This is an array of integers representing the number of items in a view list before another column is added.  For example:&lt;br /&gt;
&lt;br /&gt;
 [ 11 ]&lt;br /&gt;
&lt;br /&gt;
The menu is rendered as a single column data if there are less than 11 entries, then there would be 2 columns.&lt;br /&gt;
&lt;br /&gt;
 [ 11, 21 ]&lt;br /&gt;
&lt;br /&gt;
This would have one column if there were ten or less values, two columns if there are twenty or less, and three columns for all other cases.&lt;br /&gt;
&lt;br /&gt;
 [ 0, 0 ]&lt;br /&gt;
&lt;br /&gt;
This would always have three columns.&lt;br /&gt;
&lt;br /&gt;
 [ 2, 3 ]&lt;br /&gt;
&lt;br /&gt;
This would have one column for a single data, two columns for two, and three columns for three or more data.&lt;br /&gt;
&lt;br /&gt;
Add one to the number of integers in the array and you get the maximum number of columns. The entries are evenly distributed in the columns.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sections===&lt;br /&gt;
&lt;br /&gt;
When a menu is using &amp;quot;sections&amp;quot;, then items on the menu are grouped together. The exact method is defined by defining values for several options. These options go to the ''menus section'' as well.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|grouping_function &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|This function determines how grouping is done. The following predefined functions can be used:&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_a_to_z&amp;quot;&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_first_character&amp;quot; (default)&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_2_characters&amp;quot;&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_3_characters&amp;quot;&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_4_characters&amp;quot;&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_5_characters&amp;quot;&lt;br /&gt;
with the usual meaning. If you use 'group_by_a_to_z', all entries not starting with a letter will be discarded.&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|group_sorting_function &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|A costum function which sorts the group identifiers. The only available function&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::default_sort&amp;quot;&lt;br /&gt;
sorts alphabetically.&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|group_range_function &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Splits the groups (as determined by the grouping function) into sections so that a group never splits. Groups are rendered separately, but a section is kept on a single page. Available grouping functions are&lt;br /&gt;
*&amp;quot;Eprints::Update::Views::no_ranges&amp;quot; (default)&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::cluster_ranges_&amp;lt;range&amp;gt;&amp;quot;&lt;br /&gt;
where &amp;lt;range&amp;gt; is one of 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, and 200.&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|open_first_section &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|if set, the first section is included in the front page.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Phrases==&lt;br /&gt;
&lt;br /&gt;
Views can have their own titles and other phrases. If they do not exist, then a default one is used (usually containing the view's id). For examples, see the views.xml file.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewname_eprint_&amp;lt;viewid&amp;gt;&lt;br /&gt;
|the name of the browse pages&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewintro_&amp;lt;viewid&amp;gt;&lt;br /&gt;
|The phrase to replace the text &amp;quot;Please select a value to browse from the list below.&amp;quot; in the top level menu&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewintro_&amp;lt;viewid&amp;gt;/&amp;lt;value&amp;gt;&lt;br /&gt;
|Intro phrase on the next level&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewtitle_eprint_&amp;lt;viewid&amp;gt;_menu_&amp;lt;level&amp;gt;&lt;br /&gt;
|Title of browse page at level &amp;lt;level&amp;gt;, which is 1, 2, ... In the phrase you can use the pins &amp;quot;value1&amp;quot;, &amp;quot;value2&amp;quot;, etc. where the number can be one less than the present level; the value of the pin is the actual value of the previous levels. See the example below.&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewgroup_eprint_&amp;lt;viewid&amp;gt;_&amp;lt;filename&amp;gt;&lt;br /&gt;
|Used as a pin value for the title on the list pages, when [[#Variations|variations]] are used. &amp;lt;Filename&amp;gt; is the filename defined as the option of the variation, or, if it is not defined, then it is the fieldname at the beginning.&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewtitle_eprint_&amp;lt;viewid&amp;gt;_list&lt;br /&gt;
|Title of the list pages of the view. You can use the same pins as before (&amp;quot;value1&amp;quot;, &amp;quot;value2&amp;quot;, etc.). If the list was generated by a [[#Variations|variation]] then the &amp;quot;grouping&amp;quot; pin is also available.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following example shows how to define these values.&lt;br /&gt;
 &amp;lt;epp:phrase id=&amp;quot;viewname_eprint_divisions&amp;quot;&amp;gt;Divisions&amp;lt;/epp:phrase&amp;gt;&lt;br /&gt;
 &amp;lt;epp:phrase id=&amp;quot;viewtitle_eprint_divisions_menu_1&amp;quot;&amp;gt;&lt;br /&gt;
    Browse by Division and Year&amp;lt;/epp:phrase&amp;gt;&lt;br /&gt;
 &amp;lt;epp:phrase id=&amp;quot;viewtitle_eprint_divisions_menu_2&amp;quot;&amp;gt;&lt;br /&gt;
    Browse by Year where Division is&lt;br /&gt;
     &amp;lt;epc:pin name=&amp;quot;value1&amp;quot; /&amp;gt; &amp;lt;/epp:phrase&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|heading_level&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
|include&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
|subheadings&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
|nohtml&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
|noindex&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
==EPrints 3.2 example==&lt;br /&gt;
===cfg/cfg.d/views.pl===&lt;br /&gt;
  { id         =&amp;gt; &amp;quot;target&amp;quot;,  # The 'name' for this view&lt;br /&gt;
    allow_null =&amp;gt; 0,&lt;br /&gt;
    hide_empty =&amp;gt; 1,&lt;br /&gt;
    menus      =&amp;gt; [&lt;br /&gt;
      { fields =&amp;gt; [&amp;quot;broker_reponame&amp;quot;], # The field(s) to use - in this case the 'reponame' sub-element of the 'broker' field&lt;br /&gt;
        new_column_at      =&amp;gt; [0],    # force 2 columns, even if the&lt;br /&gt;
                                      # second is blank&lt;br /&gt;
        mode               =&amp;gt; &amp;quot;sections&amp;quot;,&lt;br /&gt;
        open_first_section =&amp;gt; 1,&lt;br /&gt;
        group_range_function   =&amp;gt; &amp;quot;EPrints::Update::Views::cluster_ranges_30&amp;quot;,&lt;br /&gt;
        group_sorting_function =&amp;gt; &amp;quot;EPrints::Update::Views::default_sort&amp;quot;,&lt;br /&gt;
      },&lt;br /&gt;
    ],&lt;br /&gt;
    order =&amp;gt; &amp;quot;-date/title&amp;quot;,&lt;br /&gt;
    citation =&amp;gt; 'router',    # This defines the file in cfg/citations/eprint/&lt;br /&gt;
    layout   =&amp;gt; 'router',    # This is used in Views.pm to determine how to&lt;br /&gt;
                             # join individual citations together...&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
This creates a view, which will be 2-columns wide.&lt;br /&gt;
Two important definitions here are:&lt;br /&gt;
* '''citation''' defines the citation file used to create the block of html for each record to be displayed, and&lt;br /&gt;
* '''layout''' indicates how those blocks are joined together.&lt;br /&gt;
&lt;br /&gt;
====Layout====&lt;br /&gt;
'''Layout''' can be one of:&lt;br /&gt;
* paragraph (the default)&lt;br /&gt;
puts &amp;amp;lt;p&amp;gt; elements round each citation&lt;br /&gt;
&lt;br /&gt;
* orderedlist&lt;br /&gt;
makes an ordered list (1,2,3,4 or whatever the CSS defines)&lt;br /&gt;
&lt;br /&gt;
* unorderedlist&lt;br /&gt;
makes an unordered list&lt;br /&gt;
&lt;br /&gt;
* ''anything else''&lt;br /&gt;
just puts a newline (in the page source) after each citation&lt;br /&gt;
&lt;br /&gt;
====citation====&lt;br /&gt;
In our example, we're using a home-made citation layout&lt;br /&gt;
&lt;br /&gt;
The citation file is in &amp;lt;code&amp;gt;/cfg/citations/eprint/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above view, we have defined the citation format to be '''router''', therefore we need a file called '''router.xml''' in the citations directory.&lt;br /&gt;
&lt;br /&gt;
Remember this format is used for each record, so needs to be complete in it's own right - and if you want records to line up vertically, you need to plan that in advance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
    &amp;amp;lt;!-- &lt;br /&gt;
  	Full citation for an eprint. &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;amp;lt;cite:citation xmlns:xhtml=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xmlns=&amp;quot;http://eprints.org/ep3/control&amp;quot; xmlns:cite=&amp;quot;http://eprints.org/ep3/citation&amp;quot; &amp;gt;&lt;br /&gt;
    &amp;amp;lt;table class='ep_rt_citation'&amp;gt;;&lt;br /&gt;
    &amp;amp;lt;tr&amp;gt;&amp;amp;lt;td colspan='2'&amp;gt;&lt;br /&gt;
    &amp;amp;lt;choose&amp;gt;&lt;br /&gt;
      &amp;amp;lt;when test=&amp;quot;type = 'book' and is_set( creators )&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;amp;lt;span class='strong'&amp;gt;&amp;amp;lt;print expr=&amp;quot;creators_name&amp;quot;/&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;amp;lt;/when&amp;gt;&lt;br /&gt;
      .... more code ....&lt;br /&gt;
    &amp;amp;lt;/choose&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/td&amp;gt;&amp;amp;lt;td style=&amp;quot;width:8em&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;amp;lt;if test=&amp;quot;date&amp;quot;&amp;gt;&amp;amp;lt;span class='right strong'&amp;gt;(&amp;amp;lt;print expr=&amp;quot;date&amp;quot; opts=&amp;quot;res=year&amp;quot;/&amp;gt;)&amp;amp;lt;/span&amp;gt;&amp;amp;lt;/if&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/td&amp;gt;&amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;amp;lt;tr&amp;gt;&amp;amp;lt;td style=&amp;quot;width:50%&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;amp;lt;cite:linkhere&amp;gt;&amp;amp;lt;xhtml:em&amp;gt;&amp;amp;lt;print expr=&amp;quot;title&amp;quot; opts=&amp;quot;magicstop&amp;quot;/&amp;gt;&amp;amp;lt;/xhtml:em&amp;gt;&amp;amp;lt;/cite:linkhere&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;amp;lt;choose&amp;gt;&lt;br /&gt;
     .... more code&lt;br /&gt;
    &amp;amp;lt;when test=&amp;quot;type = 'article'&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;amp;lt;if test=&amp;quot;publication&amp;quot;&amp;gt;&amp;amp;lt;print expr=&amp;quot;publication&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;amp;lt;if test=&amp;quot;volume&amp;quot;&amp;gt;, &amp;amp;lt;print expr=&amp;quot;volume&amp;quot;/&amp;gt;&amp;amp;lt;/if&amp;gt;&lt;br /&gt;
        &amp;amp;lt;if test=&amp;quot;number&amp;quot;&amp;gt; (&amp;amp;lt;print expr=&amp;quot;number&amp;quot;/&amp;gt;)&amp;amp;lt;/if&amp;gt;&lt;br /&gt;
        .&amp;amp;lt;/if&amp;gt;&lt;br /&gt;
      &amp;amp;lt;if test=&amp;quot;pagerange&amp;quot;&amp;gt; &amp;amp;lt;print expr=&amp;quot;pagerange&amp;quot;/&amp;gt;.&amp;amp;lt;/if&amp;gt;&lt;br /&gt;
      &amp;amp;lt;/td&amp;gt;&amp;amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;amp;lt;if test=&amp;quot;issn&amp;quot;&amp;gt;&amp;lt;span class='right'&amp;gt; ISSN &amp;lt;print expr=&amp;quot;issn&amp;quot;/&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/if&amp;gt;&lt;br /&gt;
      &amp;amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/when&amp;gt;&lt;br /&gt;
    .... more code&lt;br /&gt;
  &amp;amp;lt;/choose&amp;gt;&lt;br /&gt;
  &amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;amp;lt;if test=&amp;quot; ! type.one_of( 'patent','thesis' )&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;amp;lt;if test=&amp;quot;ispublished.one_of('unpub', 'submitted', 'inpress')&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;amp;lt;tr&amp;gt;&amp;amp;lt;td colspan='2'&amp;gt;&lt;br /&gt;
     (&amp;amp;lt;print expr=&amp;quot;ispublished&amp;quot;/&amp;gt;)&lt;br /&gt;
    &amp;amp;lt;/td&amp;gt;&amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/if&amp;gt;&lt;br /&gt;
  &amp;amp;lt;/if&amp;gt;&lt;br /&gt;
  &amp;amp;lt;/table&amp;gt;&lt;br /&gt;
  &amp;amp;lt;/cite:citation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a table for each record, and CSS is used to manage the size &amp;amp; position of the various elements&lt;br /&gt;
&lt;br /&gt;
===cfg/cfg.d/eprint_render.pl===&lt;br /&gt;
When viewing a record, the main abstract view page can also be altered&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;cfg/cfg.d/eprint_render.pl&amp;lt;/code&amp;gt;, towards the bottom of the subroutine &amp;lt;code&amp;gt;$c-&amp;gt;{eprint_render}&amp;lt;/code&amp;gt; is the following line:&lt;br /&gt;
&lt;br /&gt;
   my $page = $eprint-&amp;gt;render_citation( &amp;quot;router_page&amp;quot;, %fragments, flags=&amp;gt;$flags );&lt;br /&gt;
&lt;br /&gt;
Here, '''router_page''' is the name of the citation file for creating the abstract page..... '''router_page.xml''' in this case&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Views.pl&amp;diff=11131</id>
		<title>Views.pl</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Views.pl&amp;diff=11131"/>
		<updated>2015-03-06T15:24:47Z</updated>

		<summary type="html">&lt;p&gt;Kiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Browse Views]]&lt;br /&gt;
[[Category:Documentation Needed]]&lt;br /&gt;
== Views ==&lt;br /&gt;
Conceptually a ''view'' is a browsable list of eprints split into ''menus'' and a ''list''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
{| cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-color:black; border-style:solid; border-width:1px 1px 0 1px; margin:0; padding:0; text-align:center; font-size:10px&amp;quot; |Menu1&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px; text-align: left; margin:0; padding:0; font-size:10px&amp;quot;| &amp;amp;nbsp; Item1_1 ------&lt;br /&gt;
| style=&amp;quot;font-size:10px&amp;quot;|---&amp;gt;&lt;br /&gt;
| style=&amp;quot;border-color:black; border-style:solid; border-width:1px 1px 0 1px; margin:0; padding:0; text-align:center; font-size:10px&amp;quot;|Menu2&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px; text-align: left; font-size:10px&amp;quot;| &amp;amp;nbsp; Item1_2 &lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px; text-align: left; margin:0; padding:0; font-size:10px&amp;quot;| &amp;amp;nbsp; Item2_1 ----- &lt;br /&gt;
|style=&amp;quot;font-size:10px&amp;quot;|---&amp;gt;&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:1px 1px 0 1px; margin:0; padding:0; text-align:center; font-size:10px&amp;quot;| &amp;amp;nbsp; &amp;amp;nbsp; LIST &amp;amp;nbsp; &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px 1px 1px; margin:0; padding:0; text-align:left; font-size:10px&amp;quot;| &amp;amp;nbsp; ....&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px; text-align: left; margin:0; padding:0; font-size:10px&amp;quot;| &amp;amp;nbsp; Item2_2&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px 1px 1px; margin:0; padding:0; text-align:left; font-size:10px&amp;quot;| &amp;amp;nbsp; ....&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;border-color:black; border-style:solid; border-width:0 1px 1px 1px; margin:0; padding:0; text-align:left; font-size:10px&amp;quot;| &amp;amp;nbsp; ....&lt;br /&gt;
| &amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In a ''menu'' values of one (or more) fields are listed, and a link points to the collection of all items with that particular value in that field.&lt;br /&gt;
&lt;br /&gt;
The ''list'' contains the final list of eprints with field values as determined by the menus above it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Options available for the views config ==&lt;br /&gt;
This link is an [http://wiki.eprints.org/w/Adding_new_views 'How to' about views] with examples.&lt;br /&gt;
&lt;br /&gt;
The general form of views definition is&lt;br /&gt;
&lt;br /&gt;
  $c-&amp;gt;{browse_views} = [&lt;br /&gt;
    { &amp;lt;first view definition&amp;gt; },&lt;br /&gt;
    { &amp;lt;second view definition&amp;gt; },&lt;br /&gt;
    ...&lt;br /&gt;
    { &amp;lt;last view definition&amp;gt; },&lt;br /&gt;
  ];&lt;br /&gt;
&lt;br /&gt;
(be careful about commas and semicolons). The order of the view definitions determines the order in which these will appear in the &amp;lt;nowiki&amp;gt;http://repoid/view/&amp;lt;/nowiki&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
Each view definition is a collection of attributes, given as&lt;br /&gt;
&lt;br /&gt;
    attribute1 =&amp;gt; value1,&lt;br /&gt;
    attribute2 =&amp;gt; value2,&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
(again, the ''value'' should end by a comma). The ''value'' can be&lt;br /&gt;
*''integer''&lt;br /&gt;
*''string'' enclosed by quotation marks (&amp;quot;) or by apostrophes (')&lt;br /&gt;
*''array'' which starts by a square bracket [ followed by the elements of the array (separated by commas) and closed by ] or &lt;br /&gt;
*''hash'' which is a list of &amp;quot;attribute =&amp;gt; value&amp;quot; pairs enclosed by curly brackets { and }.&lt;br /&gt;
Thus the browse_views definition is an array of hashes.&lt;br /&gt;
&lt;br /&gt;
Attributes marked by &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt; are ''view'' attributes and are in the view definition; attributes marked by &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt; are ''menu'' attributes and should be used only in [[#Menu options|menu definitions]].&lt;br /&gt;
&lt;br /&gt;
==Basic options==&lt;br /&gt;
&lt;br /&gt;
Options in the first category are ''view'' options.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| id &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
| (mandatory) String, this is the ID by which you will refer to this view, and also the name of the top directory in &amp;lt;nowiki&amp;gt;http://repoid/view/&amp;lt;/nowiki&amp;gt;. This is the value of the ''browse_link'' attribute in [[eprint_fields.pl]]. Example:&lt;br /&gt;
&lt;br /&gt;
    id =&amp;gt; 'divisions',&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|fields &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt; &lt;br /&gt;
|(deprecated) This attribute describes the field(s) by which the view is built. It has been replaced by the more general [[#Menu options|menus]] attribute.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideempty &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
allow_null &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
new_column_at &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
render_menu &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|These define the default values of the same attributes in all [[#Menu options|menus]]. I.e, if not defined otherwise there, they take this as the default value in this view. &amp;quot;Hideempty&amp;quot; is also used when rendering the [[#View list options|view]] list.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|menus &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|An array of ''[[#Menu options|menu descriptions]]''. Each ''menu'' is a refinement of the previous ones, and last menu points to the [[#View list options|view list(s)]]. In each menu, as minimum, you should give the field(s) which are used to define entries at that level. The menus definition looks like&lt;br /&gt;
  menus =&amp;gt; [&lt;br /&gt;
     { &amp;lt;first menu definition&amp;gt; },&lt;br /&gt;
     { &amp;lt;second level menu&amp;gt; },&lt;br /&gt;
     { &amp;lt;last level&amp;gt; },&lt;br /&gt;
  ],&lt;br /&gt;
You must have at least one menu level.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|template &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Define an alternate template for all pages in this view. The template page should be a proper xml file in the &amp;lt;tt&amp;gt;repoid/cfg/lang/&amp;lt;langid&amp;gt;/templates/&amp;lt;/tt&amp;gt; directory. The best way is to copy the default.xml file and edit it according to taste. &lt;br /&gt;
  template =&amp;gt; 'view_template',&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|nolink &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|When this is set to 1 by adding&lt;br /&gt;
  nolink =&amp;gt; 1,&lt;br /&gt;
then this view won't appear in the outmost &amp;lt;nowiki&amp;gt;http://repoid/view/&amp;lt;/nowiki&amp;gt; browse page.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| max_menu_age&amp;amp;nbsp;&amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
| Defaults to 86400 (one day in seconds). If the menus in this view has been generated more than that many seconds ago, it is regenerated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===View list options===&lt;br /&gt;
These are the options which determine how the last list page in the menu chain should look like. They must be entered at the outmost ''view'' level. &lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|order &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|This defines how the items in the view list (at the lowest level) are ordered. The format is 'foo/-bar'. This means that the list will be sorted by 'foo' and then any equal 'foo' values will be reverse sorted by 'bar'. More than 2 fields can be specified. Example:&lt;br /&gt;
  order =&amp;gt; &amp;quot;-date/title&amp;quot;,&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideup &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Don't show the &amp;quot;up one level&amp;quot; link in the list page. You ''must'' set this attribute for each menu separately, it is not inherited.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideempty &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Do not list the empty (undefined) entry in the list. This property inherits to the menus.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|nocount &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|If set, the &amp;quot;Number of items&amp;quot; line at the top of the page is omitted.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|notimestamp &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|If set, the &amp;quot;This list was generated on&amp;quot; line at the bottom of the list is omitted.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|variations &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|An array of strings describing different rendering of the items at the ''list''. For datails see [[#Variations|variations]]. Example:&lt;br /&gt;
    variation =&amp;gt; [ &amp;quot;creators_name;first_letter&amp;quot;, &lt;br /&gt;
        &amp;quot;type&amp;quot;, &amp;quot;DEFAULT&amp;quot;, ],&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|layout &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Possible values are &lt;br /&gt;
*paragraph (default)&lt;br /&gt;
*orderedlist&lt;br /&gt;
*unorderedlist&lt;br /&gt;
Determines how items in the list (or sublist) is rendered. In the first case each item is a paragraph by itself. In the other cases items are rendered as an ordered (unordered) list.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|citation &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|The citation style defined in archives/&amp;lt;REPOID&amp;gt;/cfg/citations/eprint/ which is used to render each item. Example:&lt;br /&gt;
  citation =&amp;gt; 'screen',&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|max_list_age&amp;amp;nbsp;&amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(V)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Defaults to 86400 (one day in seconds). If the lists in this view were generated more than than many seconds ago, it is regenerated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Variations===&lt;br /&gt;
&lt;br /&gt;
Variations, if defined, determine how the final list is rendered. ''Variations'' is an array of strings, for example,&lt;br /&gt;
&lt;br /&gt;
 [ &amp;quot;creators_name;first_letter&amp;quot;,&lt;br /&gt;
   &amp;quot;type&amp;quot;,&lt;br /&gt;
   &amp;quot;DEFAULT&amp;quot;,&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
For each string in the list, a different rendering is produced, and you can switch from one to the other. The variation &amp;quot;DEFAULT&amp;quot; is the default one, it is always a good practice to include it in the list. If no variation is given, &amp;quot;DEFAULT&amp;quot; is used.&lt;br /&gt;
&lt;br /&gt;
A ''variation definition'' consists of a field name, followed by zero, one or more ''options'' after a semicolon. Options are separated by commas. An ''option'' is either a single attribute, or an attribute, an equal sign, and the value of the attribute. For example,&lt;br /&gt;
    &amp;quot;creators_name;truncate=4,hideup&amp;quot;&lt;br /&gt;
sets the attribute value &amp;quot;truncate&amp;quot; to 4, and &amp;quot;hideup&amp;quot; to 1 (or true).&lt;br /&gt;
&lt;br /&gt;
The following options are available. These options are ''part of the string'' defining the variation, and ''should not be entered'' as attributes.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|reverse&lt;br /&gt;
|Reverses the order in which the groupings are shown.  Default is the ordervalue for that field (usually alphanumeric).  Useful for dates as you may want the highest values first.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|filename&lt;br /&gt;
|Changes the filename of the view variation.  The default is the name of the metadata field used, so if two variations use the same metadata field with different options, this is needed.&lt;br /&gt;
 filename=different_filename&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|first_value&lt;br /&gt;
|If a field is multiple, only use the first value.  Otherwise each item will appear once for each value.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|first_initial&lt;br /&gt;
|If using a name, truncate the given name to the first initial.  This will make items like &amp;quot;Les Carr&amp;quot; and &amp;quot;Leslie Carr&amp;quot; appear together.  Note it will also make &amp;quot;John Smith&amp;quot; and &amp;quot;Jake Smith&amp;quot; appear together too, showing that you really never can win.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|first_letter&lt;br /&gt;
|The same as 'truncate=1'&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|truncate&lt;br /&gt;
|Use the first X characters of a value to group by.  truncate=4 may be useful for dates as it will group by the first four digits (the year) only.&lt;br /&gt;
 truncate=4&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|tags&lt;br /&gt;
|Useful for fields like keywords where values may be separated by commas or semi-colons.  The value is split on these two characters ( , and ; ) and a heading is created for each.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|cloud&lt;br /&gt;
|Creates a tag cloud.  Sets jump to 'plain', cloudmax to 200, cloudmin to 80 and no_separator, then resizes the jump-to links according to frequency of use.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|cloudmax&lt;br /&gt;
|The % size of the largest tag in a tag cloud.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|cloudmin&lt;br /&gt;
|The % size of the smallest tag in a tag cloud.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|jump&lt;br /&gt;
|Possible values are 'plain', 'default', and 'none'. Example:&lt;br /&gt;
  jump=plain&lt;br /&gt;
When set to 'plain' turns off the 'jump to' text before the list of subheading navigation links. When 'none', then the 'jump' part is not rendered.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|no_seperator (sic)&lt;br /&gt;
|Turns of the separator between each subheading navigation link (by default a vertical bar symbol).&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|string&lt;br /&gt;
|Uses values 'as is'.  No ordervalues, no phrases.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideup (since 3.1.1) &lt;br /&gt;
|Defaults to &amp;quot;0&amp;quot;. If set to &amp;quot;1&amp;quot; this hides the &amp;quot;up to parent&amp;quot; link (often you want to hide this on .include files)&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|render_fn&lt;br /&gt;
|Name of a function to render this groupings list of items. For an example, see views_render_items_example.pl&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Menu options===&lt;br /&gt;
&lt;br /&gt;
These options can only be used in the '''menu definitions'''.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|fields  &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Obligatory, an array of field identifiers. Items in all fields are merged together. For example, to define a list of those those who are either authors or editors or both, use the definition&lt;br /&gt;
&lt;br /&gt;
    fields =&amp;gt; [ &amp;quot;creators_id&amp;quot;, &amp;quot;editors_id&amp;quot; ],&lt;br /&gt;
&lt;br /&gt;
Even if there is a single field, you must use square brackets, such as&lt;br /&gt;
&lt;br /&gt;
    fields =&amp;gt; [ &amp;quot;subjects&amp;quot; ],&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color: #662211; background-color:#ddffdc; border:1px solid black; padding:3px;&amp;quot;&amp;gt;'''Important!''' All fields must have the same type - i.e. you cannot mix titles and authors, say.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add extra rendering info to the field name, without the &amp;quot;render_&amp;quot; prefix. For example, to make a date have resolution year, you would write&lt;br /&gt;
&lt;br /&gt;
    fields =&amp;gt; [ &amp;quot;date;res=year&amp;quot; ],&lt;br /&gt;
&lt;br /&gt;
or, ordering authors by their ''given'' names rather than by their family names:&lt;br /&gt;
&lt;br /&gt;
    fields =&amp;gt; [ &amp;quot;creators_name;order=gf&amp;quot; ],&lt;br /&gt;
&lt;br /&gt;
You can add &amp;quot;;quiet&amp;quot; to the field name to force non-existing values to appear as empty space rather than the ugly &amp;quot;UNDEFINED&amp;quot; (see the allow_null property below). You can find the available rendering properties of different fields in the [[Metadata]] section.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|allow_null &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt; &lt;br /&gt;
|The ''undefined'' value among the possible values of the fields does not show up in the generated view. To allow the undefined value to appear as well, set&lt;br /&gt;
&lt;br /&gt;
  allow_null =&amp;gt; 1,&lt;br /&gt;
&lt;br /&gt;
Beware: the title of the undefined entries will be the ugly UNDEFINED. You might consider to use the &amp;quot;;quiet&amp;quot; rendering option for field names.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideempty &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|If a category is empty, don't show it as an entry. Default value: show all entries, even if they contain no entries. Used only in menus, not at the lower level (list).&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
    hideempty =&amp;gt; 1,&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|reverse_order &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|If set, then the ordering of items in this menu is reversed. Example:&lt;br /&gt;
&lt;br /&gt;
    reverse_order =&amp;gt; 1,&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|mode &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Possible values: ''[[#Sections|sections]]'' and ''default'' (default). When defined as ''sections'' then grouping can be defined by the following data:&lt;br /&gt;
* ''grouping_function'' (group by first character if not defined)&lt;br /&gt;
* ''group_sorting_function'' (how to sort members of a group)&lt;br /&gt;
* ''group_range_function''&lt;br /&gt;
* ''open_first_section'' the front page should show the first section&lt;br /&gt;
See [[#Sections|below]].&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|hideup &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|When set to 1, don't show the &amp;quot;move one level up&amp;quot; link at the top of the page.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|render_menu &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|The configuration parameter which renders this menu. This should be a string, and also you should define a routine with the same name. For example if you write&lt;br /&gt;
    render_menu =&amp;gt; 'render_view_menu_3col_boxes',&lt;br /&gt;
then this menu will be rendered by the routine which is defined in [[views_render_menu_example.pl]] as&lt;br /&gt;
  $c-&amp;gt;{render_view_menu_3col_boxes} = sub&lt;br /&gt;
  {&lt;br /&gt;
       ...&lt;br /&gt;
  }&lt;br /&gt;
See there for hints how to tweak your own routine.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|new_column_at &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Used in menus (not lists) and in default mode. This is an array of integers representing the number of items in a view list before another column is added.  For example:&lt;br /&gt;
&lt;br /&gt;
 [ 11 ]&lt;br /&gt;
&lt;br /&gt;
The menu is rendered as a single column data if there are less than 11 entries, then there would be 2 columns.&lt;br /&gt;
&lt;br /&gt;
 [ 11, 21 ]&lt;br /&gt;
&lt;br /&gt;
This would have one column if there were ten or less values, two columns if there are twenty or less, and three columns for all other cases.&lt;br /&gt;
&lt;br /&gt;
 [ 0, 0 ]&lt;br /&gt;
&lt;br /&gt;
This would always have three columns.&lt;br /&gt;
&lt;br /&gt;
 [ 2, 3 ]&lt;br /&gt;
&lt;br /&gt;
This would have one column for a single data, two columns for two, and three columns for three or more data.&lt;br /&gt;
&lt;br /&gt;
Add one to the number of integers in the array and you get the maximum number of columns. The entries are evenly distributed in the columns.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sections===&lt;br /&gt;
&lt;br /&gt;
When a menu is using &amp;quot;sections&amp;quot;, then items on the menu are grouped together. The exact method is defined by defining values for several options. These options go to the ''menus section'' as well.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|grouping_function &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|This function determines how grouping is done. The following predefined functions can be used:&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_a_to_z&amp;quot;&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_first_character&amp;quot; (default)&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_2_characters&amp;quot;&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_3_characters&amp;quot;&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_4_characters&amp;quot;&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::group_by_5_characters&amp;quot;&lt;br /&gt;
with the usual meaning. If you use 'group_by_a_to_z', all entries not starting with a letter will be discarded.&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|group_sorting_function &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|A costum function which sorts the group identifiers. The only available function&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::default_sort&amp;quot;&lt;br /&gt;
sorts alphabetically.&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|group_range_function &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Splits the groups (as determined by the grouping function) into sections so that a group never splits. Groups are rendered separately, but a section is kept on a single page. Available grouping functions are&lt;br /&gt;
*&amp;quot;Eprints::Update::Views::no_ranges&amp;quot; (default)&lt;br /&gt;
*&amp;quot;EPrints::Update::Views::cluster_ranges_&amp;lt;range&amp;gt;&amp;quot;&lt;br /&gt;
where &amp;lt;range&amp;gt; is one of 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, and 200.&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|open_first_section &amp;lt;sup style=&amp;quot;font-weight:bold; font-size:10px;&amp;quot;&amp;gt;(M)&amp;lt;/sup&amp;gt;&lt;br /&gt;
|if set, the first section is included in the front page.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Phrases==&lt;br /&gt;
&lt;br /&gt;
Views can have their own titles and other phrases. If they do not exist, then a default one is used (usually containing the view's id). For examples, see the views.xml file.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewname_eprint_&amp;lt;viewid&amp;gt;&lt;br /&gt;
|the name of the browse pages&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewintro_&amp;lt;viewid&amp;gt;&lt;br /&gt;
|The phrase to replace the text &amp;quot;Please select a value to browse from the list below.&amp;quot; in the top level menu&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewintro_&amp;lt;viewid&amp;gt;/&amp;lt;value&amp;gt;&lt;br /&gt;
|Intro phrase on the next level&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewtitle_eprint_&amp;lt;viewid&amp;gt;_menu_&amp;lt;level&amp;gt;&lt;br /&gt;
|Title of browse page at level &amp;lt;level&amp;gt;, which is 1, 2, ... In the phrase you can use the pins &amp;quot;value1&amp;quot;, &amp;quot;value2&amp;quot;, etc. where the number can be one less than the present level; the value of the pin is the actual value of the previous levels. See the example below.&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewgroup_eprint_&amp;lt;viewid&amp;gt;_&amp;lt;filename&amp;gt;&lt;br /&gt;
|Used as a pin value for the title on the list pages, when [[#Variations|variations]] are used. &amp;lt;Filename&amp;gt; is the filename defined as the option of the variation, or, if it is not defined, then it is the fieldname at the beginning.&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|viewtitle_eprint_&amp;lt;viewid&amp;gt;_list&lt;br /&gt;
|Title of the list pages of the view. You can use the same pins as before (&amp;quot;value1&amp;quot;, &amp;quot;value2&amp;quot;, etc.). If the list was generated by a [[#Variations|variation]] then the &amp;quot;grouping&amp;quot; pin is also available.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following example shows how to define these values.&lt;br /&gt;
 &amp;lt;epp:phrase id=&amp;quot;viewname_eprint_divisions&amp;quot;&amp;gt;Divisions&amp;lt;/epp:phrase&amp;gt;&lt;br /&gt;
 &amp;lt;epp:phrase id=&amp;quot;viewtitle_eprint_divisions_menu_1&amp;quot;&amp;gt;&lt;br /&gt;
    Browse by Division and Year&amp;lt;/epp:phrase&amp;gt;&lt;br /&gt;
 &amp;lt;epp:phrase id=&amp;quot;viewtitle_eprint_divisions_menu_2&amp;quot;&amp;gt;&lt;br /&gt;
    Browse by Year where Division is&lt;br /&gt;
     &amp;lt;epc:pin name=&amp;quot;value1&amp;quot; /&amp;gt; &amp;lt;/epp:phrase&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|heading_level&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
|include&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
|subheadings&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
|nohtml&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
|noindex&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
==EPrints 3.2 example==&lt;br /&gt;
===cfg/cfg.d/views.pl===&lt;br /&gt;
  { id         =&amp;gt; &amp;quot;target&amp;quot;,  # The 'name' for this view&lt;br /&gt;
    allow_null =&amp;gt; 0,&lt;br /&gt;
    hide_empty =&amp;gt; 1,&lt;br /&gt;
    menus      =&amp;gt; [&lt;br /&gt;
      { fields =&amp;gt; [&amp;quot;broker_reponame&amp;quot;], # The field(s) to use - in this case the 'reponame' sub-element of the 'broker' field&lt;br /&gt;
        new_column_at      =&amp;gt; [0],    # force 2 columns, even if the&lt;br /&gt;
                                      # second is blank&lt;br /&gt;
        mode               =&amp;gt; &amp;quot;sections&amp;quot;,&lt;br /&gt;
        open_first_section =&amp;gt; 1,&lt;br /&gt;
        group_range_function   =&amp;gt; &amp;quot;EPrints::Update::Views::cluster_ranges_30&amp;quot;,&lt;br /&gt;
        group_sorting_function =&amp;gt; &amp;quot;EPrints::Update::Views::default_sort&amp;quot;,&lt;br /&gt;
      },&lt;br /&gt;
    ],&lt;br /&gt;
    order =&amp;gt; &amp;quot;-date/title&amp;quot;,&lt;br /&gt;
    citation =&amp;gt; 'router',    # This defines the file in cfg/citations/eprint/&lt;br /&gt;
    layout   =&amp;gt; 'router',    # This is used in Views.pm to determine how to&lt;br /&gt;
                             # join individual citations together...&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
This creates a view, which will be 2-columns wide.&lt;br /&gt;
Two important definitions here are:&lt;br /&gt;
* '''citation''' defines the citation file used to create the block of html for each record to be displayed, and&lt;br /&gt;
* '''layout''' indicates how those blocks are joined together.&lt;br /&gt;
&lt;br /&gt;
====Layout====&lt;br /&gt;
'''Layout''' can be one of:&lt;br /&gt;
* paragraph (the default)&lt;br /&gt;
puts &amp;amp;lt;p&amp;gt; elements round each citation&lt;br /&gt;
&lt;br /&gt;
* orderedlist&lt;br /&gt;
makes an ordered list (1,2,3,4 or whatever the CSS defines)&lt;br /&gt;
&lt;br /&gt;
* unorderedlist&lt;br /&gt;
makes an unordered list&lt;br /&gt;
&lt;br /&gt;
* ''anything else''&lt;br /&gt;
just puts a newline (in the page source) after each citation&lt;br /&gt;
&lt;br /&gt;
====citation====&lt;br /&gt;
In our example, we're using a home-made citation layout&lt;br /&gt;
&lt;br /&gt;
The citation file is in &amp;lt;code&amp;gt;/cfg/citations/eprint/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above view, we have defined the citation format to be '''router''', therefore we need a file called '''router.xml''' in the citations directory.&lt;br /&gt;
&lt;br /&gt;
Remember this format is used for each record, so needs to be complete in it's own right - and if you want records to line up vertically, you need to plan that in advance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
    &amp;amp;lt;!-- &lt;br /&gt;
  	Full citation for an eprint. &lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;amp;lt;cite:citation xmlns:xhtml=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xmlns=&amp;quot;http://eprints.org/ep3/control&amp;quot; xmlns:cite=&amp;quot;http://eprints.org/ep3/citation&amp;quot; &amp;gt;&lt;br /&gt;
    &amp;amp;lt;table class='ep_rt_citation'&amp;gt;;&lt;br /&gt;
    &amp;amp;lt;tr&amp;gt;&amp;amp;lt;td colspan='2'&amp;gt;&lt;br /&gt;
    &amp;amp;lt;choose&amp;gt;&lt;br /&gt;
      &amp;amp;lt;when test=&amp;quot;type = 'book' and is_set( creators )&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;amp;lt;span class='strong'&amp;gt;&amp;amp;lt;print expr=&amp;quot;creators_name&amp;quot;/&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;amp;lt;/when&amp;gt;&lt;br /&gt;
      .... more code ....&lt;br /&gt;
    &amp;amp;lt;/choose&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/td&amp;gt;&amp;amp;lt;td style=&amp;quot;width:8em&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;amp;lt;if test=&amp;quot;date&amp;quot;&amp;gt;&amp;amp;lt;span class='right strong'&amp;gt;(&amp;amp;lt;print expr=&amp;quot;date&amp;quot; opts=&amp;quot;res=year&amp;quot;/&amp;gt;)&amp;amp;lt;/span&amp;gt;&amp;amp;lt;/if&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/td&amp;gt;&amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;amp;lt;tr&amp;gt;&amp;amp;lt;td style=&amp;quot;width:50%&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;amp;lt;cite:linkhere&amp;gt;&amp;amp;lt;xhtml:em&amp;gt;&amp;amp;lt;print expr=&amp;quot;title&amp;quot; opts=&amp;quot;magicstop&amp;quot;/&amp;gt;&amp;amp;lt;/xhtml:em&amp;gt;&amp;amp;lt;/cite:linkhere&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;amp;lt;choose&amp;gt;&lt;br /&gt;
     .... more code&lt;br /&gt;
    &amp;amp;lt;when test=&amp;quot;type = 'article'&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;amp;lt;if test=&amp;quot;publication&amp;quot;&amp;gt;&amp;amp;lt;print expr=&amp;quot;publication&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;amp;lt;if test=&amp;quot;volume&amp;quot;&amp;gt;, &amp;amp;lt;print expr=&amp;quot;volume&amp;quot;/&amp;gt;&amp;amp;lt;/if&amp;gt;&lt;br /&gt;
        &amp;amp;lt;if test=&amp;quot;number&amp;quot;&amp;gt; (&amp;amp;lt;print expr=&amp;quot;number&amp;quot;/&amp;gt;)&amp;amp;lt;/if&amp;gt;&lt;br /&gt;
        .&amp;amp;lt;/if&amp;gt;&lt;br /&gt;
      &amp;amp;lt;if test=&amp;quot;pagerange&amp;quot;&amp;gt; &amp;amp;lt;print expr=&amp;quot;pagerange&amp;quot;/&amp;gt;.&amp;amp;lt;/if&amp;gt;&lt;br /&gt;
      &amp;amp;lt;/td&amp;gt;&amp;amp;lt;td&amp;gt;&lt;br /&gt;
      &amp;amp;lt;if test=&amp;quot;issn&amp;quot;&amp;gt;&amp;lt;span class='right'&amp;gt; ISSN &amp;lt;print expr=&amp;quot;issn&amp;quot;/&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/if&amp;gt;&lt;br /&gt;
      &amp;amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/when&amp;gt;&lt;br /&gt;
    .... more code&lt;br /&gt;
  &amp;amp;lt;/choose&amp;gt;&lt;br /&gt;
  &amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;amp;lt;if test=&amp;quot; ! type.one_of( 'patent','thesis' )&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;amp;lt;if test=&amp;quot;ispublished.one_of('unpub', 'submitted', 'inpress')&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;amp;lt;tr&amp;gt;&amp;amp;lt;td colspan='2'&amp;gt;&lt;br /&gt;
     (&amp;amp;lt;print expr=&amp;quot;ispublished&amp;quot;/&amp;gt;)&lt;br /&gt;
    &amp;amp;lt;/td&amp;gt;&amp;amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;amp;lt;/if&amp;gt;&lt;br /&gt;
  &amp;amp;lt;/if&amp;gt;&lt;br /&gt;
  &amp;amp;lt;/table&amp;gt;&lt;br /&gt;
  &amp;amp;lt;/cite:citation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a table for each record, and CSS is used to manage the size &amp;amp; position of the various elements&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=11114</id>
		<title>SWORD 2.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=11114"/>
		<updated>2015-01-21T15:10:09Z</updated>

		<summary type="html">&lt;p&gt;Kiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 2.0 is the default implimentation in EPrints 3.3, however there is a plugin to enable SWORD 1.3 (but see below)&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''content-type''' A ''mime-type'' (usually vendor specific) which the server recognises as triggering a particular process for handling the deposit process (very important in CRUD systems).&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;application/vnd.rjbroker&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
No configuration is required - SWORD 2.0 is enabled by default.&lt;br /&gt;
There are some caveats you need to be aware of:&lt;br /&gt;
* There is only one '''collection''': &amp;lt;code&amp;gt;/id/contents&amp;lt;/code&amp;gt;&lt;br /&gt;
** All updates are done by naming the specific eprint ID&lt;br /&gt;
* By default, new records are created in the &amp;quot;review&amp;quot; buffer&lt;br /&gt;
** If the incoming request has the '''In-Progress''' header element set true, then the deposit will be put into the &amp;lt;code&amp;gt;inbox&amp;lt;/code&amp;gt;&lt;br /&gt;
** If the repository has been configured to '''skip_buffer''' then items will be put into the &amp;lt;code&amp;gt;archive&amp;lt;/code&amp;gt; buffer rather than &amp;lt;code&amp;gt;review&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of what content-types (and packages) the server understands.&lt;br /&gt;
&lt;br /&gt;
It no longer lists Q-Values.&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' If you install the SWORD 1.3 plugin into EPrints 3.3, then &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt; returns the SWORD 1.3 configuration, not the SWORD 2.0 information.&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;br /&gt;
&amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
         xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;3.3.5: Manage deposits&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;sword:version&amp;gt;2.0&amp;lt;/sword:version&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://devel.edina.ac.uk:1202/id/contents&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;atom:title&amp;gt;Eprints&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
      &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/service&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the list of accepted content is given thus:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.eprints.data+xml; charset=utf-8&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/zip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/x-gzip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/SimpleZip&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats-officedocument.wordprocessingml.document&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/msword&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.rjbroker&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/Binary&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/octet-stream&amp;lt;/accept&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that there are a mixture of '''package''' and multi-part mime-types listed.&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.3, all importers are in the same place, there is no longer a distinction between &amp;quot;SWORD&amp;quot; and anything else.&lt;br /&gt;
&lt;br /&gt;
As with all non-core code, importers are in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import&amp;lt;/tt&amp;gt;. As this is global to all repositories (in fact, all perl packages were visible to all repos under 3.2 too... the joys of Mod-Perl) plugins under &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt; are disabled by default&lt;br /&gt;
&lt;br /&gt;
You can initially develop code in &amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt; however this is non-portable, and liable to get lost if (when!) you upgrade your installation of EPrints.&lt;br /&gt;
&lt;br /&gt;
Assuming you start out creating an EPrints Package, then you need to read [[My_First_Bazaar_Package]]&lt;br /&gt;
&lt;br /&gt;
# The actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
# You need to configure the specific repository to enable the new package&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/lib/epm/&amp;lt;Bazaar_package_name&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is simply an enabling statement - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Ensure the plugin is enabled&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{&amp;quot;Import::RJ_Broker_2&amp;quot;}-&amp;gt;{params}-&amp;gt;{disable} = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, whilst the actual perl package is Eprints/Plugin/Import/Foo.pm, and will be called &amp;lt;tt&amp;gt;EPrints::Plugin::Import::Foo&amp;lt;/tt&amp;gt;, the configuration file already knows its a plugin that's being enabled, so only needs &amp;lt;tt&amp;gt;Import::Foo&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is a ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Import::RJ_Broker_2;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Import::Binary;&lt;br /&gt;
use EPrints::Plugin::Import::Archive;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Import::Archive /;&lt;br /&gt;
&lt;br /&gt;
sub new &lt;br /&gt;
{&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
&lt;br /&gt;
  # The name to display&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Who can see it, and whether we show it&lt;br /&gt;
  $self-&amp;gt;{visible}   = &amp;quot;all&amp;quot;;&lt;br /&gt;
  $self-&amp;gt;{advertise} = 1;&lt;br /&gt;
&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This defines a few important things:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is the name to display in public&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
defines what the importer actually returns (some handle specific files [.pdf, .doc, .mp3], others may import several records in one go [eg EndNote files])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Defines what content-types andh/or package-types trigger the use of this importer.&lt;br /&gt;
(two importers registering to handle the same content-type is A bad Thing&amp;lt;sup&amp;gt;[tm]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whilst this is pretty, it's actually pretty useless as all it will do is replicate what &amp;lt;tt&amp;gt;Import::Archive&amp;lt;/tt&amp;gt; does. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_fh&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sub input_fh &lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, %opts ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $fh      = $opts{fh};&lt;br /&gt;
  my $dataset = $opts{dataset};&lt;br /&gt;
  my $repo    = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
  # get the type of file (should be zip) and the filename ($zipfile) for&lt;br /&gt;
  # the file just deposited.&lt;br /&gt;
  # (local method)&lt;br /&gt;
  my $zipfile = $plugin-&amp;gt;upload_archive($fh);&lt;br /&gt;
&lt;br /&gt;
  ## Do magic to get the XML file with the metadata&lt;br /&gt;
  my $epdata = $plugin-&amp;gt;parse_epdcx_xml_data($xml_data);&lt;br /&gt;
&lt;br /&gt;
  my $dataobj = $plugin-&amp;gt;epdata_to_dataobj( $dataset, $epdata );&lt;br /&gt;
  if ( defined $dataobj ) {&lt;br /&gt;
    push @ids, $dataobj-&amp;gt;get_id;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return EPrints::List-&amp;gt;new(&lt;br /&gt;
    dataset =&amp;gt; $dataset,&lt;br /&gt;
    session =&amp;gt; $repo,&lt;br /&gt;
    ids     =&amp;gt; \@ids&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub upload_archive &lt;br /&gt;
{&lt;br /&gt;
  my ( $self, $fh ) = @_;&lt;br /&gt;
&lt;br /&gt;
  use bytes;&lt;br /&gt;
&lt;br /&gt;
  binmode($fh);&lt;br /&gt;
&lt;br /&gt;
  my $zipfile = File::Temp-&amp;gt;new();&lt;br /&gt;
  binmode($zipfile);&lt;br /&gt;
&lt;br /&gt;
  my $rc;&lt;br /&gt;
  my $lead;&lt;br /&gt;
  while ( $rc = sysread( $fh, my $buffer, 4096 ) ) {&lt;br /&gt;
    $lead = $buffer if !defined $lead;&lt;br /&gt;
    syswrite( $zipfile, $buffer );&lt;br /&gt;
  }&lt;br /&gt;
  EPrints-&amp;gt;abort(&amp;quot;Error reading from file handle: $!&amp;quot;) if !defined $rc;&lt;br /&gt;
&lt;br /&gt;
  return $zipfile;&lt;br /&gt;
} ## end sub upload_archive&lt;br /&gt;
&lt;br /&gt;
sub parse_epdcx_xml_data&lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, $xml ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $epdata         = {};&lt;br /&gt;
 &lt;br /&gt;
  ## parse the XML as needed...&lt;br /&gt;
&lt;br /&gt;
  return $epdata;&lt;br /&gt;
} ## end sub parse_epdcx_xml_data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Depositing (from Perl)==&lt;br /&gt;
&lt;br /&gt;
A SWORD deposit is, at its most basic level, just an HTTP POST request, so can be scripted fairly easily.&lt;br /&gt;
&lt;br /&gt;
This is an example of an initial deposit, where the content being posted is a bespoke format&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   # $ep is eprint to transfer&lt;br /&gt;
   my $ua = LWP::UserAgent-&amp;gt;new;&lt;br /&gt;
   my $auth = &amp;quot;Basic &amp;quot; . MIME::Base64::encode( &amp;quot;$username:$password&amp;quot;, '' );&lt;br /&gt;
&lt;br /&gt;
   my %headers = (&lt;br /&gt;
      'X-No-Op'             =&amp;gt; 'false',&lt;br /&gt;
      'X-Verbose'           =&amp;gt; 'true',&lt;br /&gt;
      'Content-Disposition' =&amp;gt; &amp;quot;filename=$filename&amp;quot;,  # The name of the &amp;quot;file&amp;quot; to be importer things its reading&lt;br /&gt;
      'Content-Type'        =&amp;gt; $mime,                 # This triggers what parses the content.  eg: application/vnd.rjbroker&lt;br /&gt;
      'User-Agent'          =&amp;gt; 'OA-RJ Broker v0.2',&lt;br /&gt;
      'Authorization'       =&amp;gt; $auth,&lt;br /&gt;
   );&lt;br /&gt;
&lt;br /&gt;
   if ($in_progress) {&lt;br /&gt;
     $headers{'in_progress'} = 'true'                 # Pushes into &amp;quot;inbox&amp;quot; rather than &amp;quot;review&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   my $url    = &amp;quot;${host}${collection}&amp;quot;;               # eg: http://eprints.example.com/id/contents&lt;br /&gt;
   my $buffer = $ep-&amp;gt;export($exporter)                # eg: Bespoke_Export_Routine (as in EPrints::Export::Bespoke_Export_Routine)&lt;br /&gt;
&lt;br /&gt;
   my $r = $ua-&amp;gt;post( $url, %headers, Content =&amp;gt; $buffer );&lt;br /&gt;
   if ( $r-&amp;gt;is_success ) {&lt;br /&gt;
     # Transferred&lt;br /&gt;
     my $content = $r-&amp;gt;content;&lt;br /&gt;
     my $return_id;&lt;br /&gt;
     if ( $content =~ m#&amp;lt;id&amp;gt;([^&amp;lt;]+)&amp;lt;/id&amp;gt;# ) {&lt;br /&gt;
        $return_id = $1 if $1;&lt;br /&gt;
     }&lt;br /&gt;
   } else {&lt;br /&gt;
     # fail&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_1.3&amp;diff=11113</id>
		<title>SWORD 1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_1.3&amp;diff=11113"/>
		<updated>2015-01-21T15:08:51Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Depositing (from Perl) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 1.3 is the only option in EPrints 3.2, and is available via an EPrints bazaar plugin in EPrints 3.3&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''mediation''' This is where one user can deposit ''on behalf of'' another user.&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Protocol implementation ==&lt;br /&gt;
&lt;br /&gt;
verbose&lt;br /&gt;
no-op&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
The default location for SWORD configuration is &lt;br /&gt;
&lt;br /&gt;
  archives/&amp;lt;your repo&amp;gt;/cfg/cfg.d/sword.pl&lt;br /&gt;
&lt;br /&gt;
This is where you enable and disable access to various ''collections'', and add/remove ''packages''&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of which &amp;quot;collections&amp;quot; are available, and what &amp;quot;packages&amp;quot; can be used with each one.&lt;br /&gt;
&lt;br /&gt;
* a &amp;quot;collection&amp;quot; in EPrints terms is &amp;lt;tt&amp;gt;inbox&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;review&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive&amp;lt;/tt&amp;gt; - which correspond to the users workspace, the administration review buffer, and visible in the live repository&lt;br /&gt;
* a &amp;quot;package&amp;quot; is an agreed method for wrapping up the data being sent over - as XML, as formatted text, in a zip file, etc...&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
   xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;OpenDepot.org&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/inbox&amp;quot;&amp;gt;&lt;br /&gt;
    .... &lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and in each collection is listed for package formats unsderstood:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;Repository Review&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;accept&amp;gt;*/*&amp;lt;/accept&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.loc.gov/METS/&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;1.0&amp;quot;&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.imsglobal.org/xsd/imscp_v1p1&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://purl.org/net/sword-types/METSDSpaceSIP&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:collectionPolicy/&amp;gt;&lt;br /&gt;
    &amp;lt;sword:treatment&amp;gt;&lt;br /&gt;
      Deposited items will undergo the review process. Upon approval, items will appear in the live repository.&lt;br /&gt;
    &amp;lt;/sword:treatment&amp;gt;&lt;br /&gt;
  &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
  &amp;lt;dcterms:abstract&amp;gt;This is the repository review.&amp;lt;/dcterms:abstract&amp;gt;&lt;br /&gt;
  &amp;lt;/collection&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.2, you need to create two things to enable a new importer&lt;br /&gt;
&lt;br /&gt;
# You need to configure the repository to recognise a new packagge format, and associate that format with the code that handles it&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# You need to write the actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/plugins/EPrints/plugin/Sword/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is relatively easy file to write - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Add in the RJ_Broker acceptance type&lt;br /&gt;
  $c-&amp;gt;{sword}-&amp;gt;{supported_packages}-&amp;gt;{&amp;quot;http://opendepot.org/broker/1.0&amp;quot;} = &lt;br /&gt;
  {&lt;br /&gt;
    name =&amp;gt; &amp;quot;Repository Junction Broker&amp;quot;,&lt;br /&gt;
    plugin =&amp;gt; &amp;quot;Sword::Import::RJ_Broker&amp;quot;,&lt;br /&gt;
    qvalue =&amp;gt; &amp;quot;0.8&amp;quot;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is the string that's shown in the servicedocument&lt;br /&gt;
* The &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; is the package used to handle the file deposited&lt;br /&gt;
* The &amp;lt;tt&amp;gt;qvalue&amp;lt;/tt&amp;gt; is what's known as the &amp;quot;Quality Value&amp;quot; - how closely the importer matches all the metadata wanted by the repository.&lt;br /&gt;
** The theory is that clients have a list of packages they can export as, and servers have a list of packages they understand - therefore a client can determine the best package for that transfer, based on relative QValues.&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt; is never run directly, and inherits most it its functions from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is another ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Sword/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Sword::Import::MyImporter;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Sword::Import;&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Sword::Import /;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sub new {&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;My Sword Importer&amp;quot;;&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is actually pretty useless as all it will do is create a blank record, with the deposited file attached as a document. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_file&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##        $opts{file} = $file;&lt;br /&gt;
##        $opts{mime_type} = $headers-&amp;gt;{content_type};&lt;br /&gt;
##        $opts{dataset_id} = $target_collection;&lt;br /&gt;
##        $opts{owner_id} = $owner-&amp;gt;get_id;&lt;br /&gt;
##        $opts{depositor_id} = $depositor-&amp;gt;get_id if(defined $depositor);&lt;br /&gt;
##        $opts{no_op}   = is this a No-op?&lt;br /&gt;
##        $opts{verbose} = is this verbosed?&lt;br /&gt;
sub input_file&lt;br /&gt;
{&lt;br /&gt;
    my ( $plugin, %opts) = @_;&lt;br /&gt;
&lt;br /&gt;
    my $session = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
    # needs to read the xml from the file:&lt;br /&gt;
    open my $fh, $file;&lt;br /&gt;
    my @xml = &amp;lt;$fh&amp;gt;;&lt;br /&gt;
    close $fh;&lt;br /&gt;
    my $xml = join '', @xml;&lt;br /&gt;
&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
    my $epdata = $plugin-&amp;gt;parse_xml($xml);&lt;br /&gt;
    my $eprint = $dataset-&amp;gt;create_object( $plugin-&amp;gt;{session}, $epdata );&lt;br /&gt;
    return $eprint;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub parse_xml&lt;br /&gt;
{&lt;br /&gt;
    my ($plugin, $xml) = @_;&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
&lt;br /&gt;
    #### do stuff&lt;br /&gt;
&lt;br /&gt;
    return $epdata;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Depositing (from Perl)==&lt;br /&gt;
&lt;br /&gt;
A SWORD deposit is, at its most basic level, just an HTTP POST request, so can be scripted fairly easily:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   # $ep is eprint to transfer&lt;br /&gt;
   my $ua = LWP::UserAgent-&amp;gt;new;&lt;br /&gt;
   my $auth = &amp;quot;Basic &amp;quot; . MIME::Base64::encode( &amp;quot;$username:$password&amp;quot;, '' );  # eg: sworduser:mySecretPassword&lt;br /&gt;
&lt;br /&gt;
   my %headers = (&lt;br /&gt;
      'X-Packaging'         =&amp;gt; $package,              # eg: http://opendepot.org/broker/1.0&lt;br /&gt;
      'X-No-Op'             =&amp;gt; 'false',&lt;br /&gt;
      'X-Verbose'           =&amp;gt; 'true',&lt;br /&gt;
      'Content-Disposition' =&amp;gt; &amp;quot;filename=$filename&amp;quot;,  # The name of the &amp;quot;file&amp;quot; to be importer things its reading&lt;br /&gt;
      'Content-Type'        =&amp;gt; $mime,                 # eg: application/zip&lt;br /&gt;
      'User-Agent'          =&amp;gt; 'OA-RJ Broker v0.2',&lt;br /&gt;
      'Authorization'       =&amp;gt; $auth,&lt;br /&gt;
   );&lt;br /&gt;
   my $url    = &amp;quot;${host}${collection}&amp;quot;;               # eg: http://eprints.example.com/sword-app/deposit/review&lt;br /&gt;
   my $buffer = $ep-&amp;gt;export($exporter)                # eg BibTeX (as in EPrints::Export::BibTeX)&lt;br /&gt;
&lt;br /&gt;
   my $r = $ua-&amp;gt;post( $url, %headers, Content =&amp;gt; $buffer );&lt;br /&gt;
   if ( $r-&amp;gt;is_success ) {&lt;br /&gt;
     # Transferred&lt;br /&gt;
     my $content = $r-&amp;gt;content;&lt;br /&gt;
     my $return_id;&lt;br /&gt;
     if ( $content =~ m#&amp;lt;atom:id&amp;gt;([^&amp;lt;]+)&amp;lt;/atom:id&amp;gt;# ) {&lt;br /&gt;
        $return_id = $1 if $1;&lt;br /&gt;
     }&lt;br /&gt;
   } else {&lt;br /&gt;
     # fail&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_1.3&amp;diff=11112</id>
		<title>SWORD 1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_1.3&amp;diff=11112"/>
		<updated>2015-01-21T15:05:00Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Depositing (from Perl) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 1.3 is the only option in EPrints 3.2, and is available via an EPrints bazaar plugin in EPrints 3.3&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''mediation''' This is where one user can deposit ''on behalf of'' another user.&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Protocol implementation ==&lt;br /&gt;
&lt;br /&gt;
verbose&lt;br /&gt;
no-op&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
The default location for SWORD configuration is &lt;br /&gt;
&lt;br /&gt;
  archives/&amp;lt;your repo&amp;gt;/cfg/cfg.d/sword.pl&lt;br /&gt;
&lt;br /&gt;
This is where you enable and disable access to various ''collections'', and add/remove ''packages''&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of which &amp;quot;collections&amp;quot; are available, and what &amp;quot;packages&amp;quot; can be used with each one.&lt;br /&gt;
&lt;br /&gt;
* a &amp;quot;collection&amp;quot; in EPrints terms is &amp;lt;tt&amp;gt;inbox&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;review&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive&amp;lt;/tt&amp;gt; - which correspond to the users workspace, the administration review buffer, and visible in the live repository&lt;br /&gt;
* a &amp;quot;package&amp;quot; is an agreed method for wrapping up the data being sent over - as XML, as formatted text, in a zip file, etc...&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
   xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;OpenDepot.org&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/inbox&amp;quot;&amp;gt;&lt;br /&gt;
    .... &lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and in each collection is listed for package formats unsderstood:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;Repository Review&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;accept&amp;gt;*/*&amp;lt;/accept&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.loc.gov/METS/&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;1.0&amp;quot;&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.imsglobal.org/xsd/imscp_v1p1&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://purl.org/net/sword-types/METSDSpaceSIP&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:collectionPolicy/&amp;gt;&lt;br /&gt;
    &amp;lt;sword:treatment&amp;gt;&lt;br /&gt;
      Deposited items will undergo the review process. Upon approval, items will appear in the live repository.&lt;br /&gt;
    &amp;lt;/sword:treatment&amp;gt;&lt;br /&gt;
  &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
  &amp;lt;dcterms:abstract&amp;gt;This is the repository review.&amp;lt;/dcterms:abstract&amp;gt;&lt;br /&gt;
  &amp;lt;/collection&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.2, you need to create two things to enable a new importer&lt;br /&gt;
&lt;br /&gt;
# You need to configure the repository to recognise a new packagge format, and associate that format with the code that handles it&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# You need to write the actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/plugins/EPrints/plugin/Sword/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is relatively easy file to write - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Add in the RJ_Broker acceptance type&lt;br /&gt;
  $c-&amp;gt;{sword}-&amp;gt;{supported_packages}-&amp;gt;{&amp;quot;http://opendepot.org/broker/1.0&amp;quot;} = &lt;br /&gt;
  {&lt;br /&gt;
    name =&amp;gt; &amp;quot;Repository Junction Broker&amp;quot;,&lt;br /&gt;
    plugin =&amp;gt; &amp;quot;Sword::Import::RJ_Broker&amp;quot;,&lt;br /&gt;
    qvalue =&amp;gt; &amp;quot;0.8&amp;quot;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is the string that's shown in the servicedocument&lt;br /&gt;
* The &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; is the package used to handle the file deposited&lt;br /&gt;
* The &amp;lt;tt&amp;gt;qvalue&amp;lt;/tt&amp;gt; is what's known as the &amp;quot;Quality Value&amp;quot; - how closely the importer matches all the metadata wanted by the repository.&lt;br /&gt;
** The theory is that clients have a list of packages they can export as, and servers have a list of packages they understand - therefore a client can determine the best package for that transfer, based on relative QValues.&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt; is never run directly, and inherits most it its functions from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is another ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Sword/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Sword::Import::MyImporter;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Sword::Import;&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Sword::Import /;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sub new {&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;My Sword Importer&amp;quot;;&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is actually pretty useless as all it will do is create a blank record, with the deposited file attached as a document. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_file&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##        $opts{file} = $file;&lt;br /&gt;
##        $opts{mime_type} = $headers-&amp;gt;{content_type};&lt;br /&gt;
##        $opts{dataset_id} = $target_collection;&lt;br /&gt;
##        $opts{owner_id} = $owner-&amp;gt;get_id;&lt;br /&gt;
##        $opts{depositor_id} = $depositor-&amp;gt;get_id if(defined $depositor);&lt;br /&gt;
##        $opts{no_op}   = is this a No-op?&lt;br /&gt;
##        $opts{verbose} = is this verbosed?&lt;br /&gt;
sub input_file&lt;br /&gt;
{&lt;br /&gt;
    my ( $plugin, %opts) = @_;&lt;br /&gt;
&lt;br /&gt;
    my $session = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
    # needs to read the xml from the file:&lt;br /&gt;
    open my $fh, $file;&lt;br /&gt;
    my @xml = &amp;lt;$fh&amp;gt;;&lt;br /&gt;
    close $fh;&lt;br /&gt;
    my $xml = join '', @xml;&lt;br /&gt;
&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
    my $epdata = $plugin-&amp;gt;parse_xml($xml);&lt;br /&gt;
    my $eprint = $dataset-&amp;gt;create_object( $plugin-&amp;gt;{session}, $epdata );&lt;br /&gt;
    return $eprint;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub parse_xml&lt;br /&gt;
{&lt;br /&gt;
    my ($plugin, $xml) = @_;&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
&lt;br /&gt;
    #### do stuff&lt;br /&gt;
&lt;br /&gt;
    return $epdata;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Depositing (from Perl)==&lt;br /&gt;
&lt;br /&gt;
A SWORD deposit is, at its most basic level, just an HTTP POST request, so can be scripted fairly easily:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   # $ep is eprint to transfer&lt;br /&gt;
   my $ua = LWP::UserAgent-&amp;gt;new;&lt;br /&gt;
   my $auth = &amp;quot;Basic &amp;quot; . MIME::Base64::encode( &amp;quot;$username:$password&amp;quot;, '' );  # eg: sworduser:mySecretPassword&lt;br /&gt;
&lt;br /&gt;
   my %headers = (&lt;br /&gt;
      'X-Packaging'         =&amp;gt; $package,              # eg: http://opendepot.org/broker/1.0&lt;br /&gt;
      'X-No-Op'             =&amp;gt; 'false',&lt;br /&gt;
      'X-Verbose'           =&amp;gt; 'true',&lt;br /&gt;
      'Content-Disposition' =&amp;gt; &amp;quot;filename=$filename&amp;quot;,  # The name of the &amp;quot;file&amp;quot; to be importer things its reading&lt;br /&gt;
      'Content-Type'        =&amp;gt; $mime,                 # eg: application/zip&lt;br /&gt;
      'User-Agent'          =&amp;gt; 'OA-RJ Broker v0.2',&lt;br /&gt;
      'Authorization'       =&amp;gt; $auth,&lt;br /&gt;
   );&lt;br /&gt;
   my $url    = &amp;quot;${host}${collection}&amp;quot;;               # eg: http://eprints.example.com/sword-app/deposit/review&lt;br /&gt;
   my $buffer = $ep-&amp;gt;export($exporter)                # eg BibTeX&lt;br /&gt;
&lt;br /&gt;
   my $r = $ua-&amp;gt;post( $url, %headers, Content =&amp;gt; $buffer );&lt;br /&gt;
   if ( $r-&amp;gt;is_success ) {&lt;br /&gt;
     # Transferred&lt;br /&gt;
     my $content = $r-&amp;gt;content;&lt;br /&gt;
     my $return_id;&lt;br /&gt;
     if ( $content =~ m#&amp;lt;atom:id&amp;gt;([^&amp;lt;]+)&amp;lt;/atom:id&amp;gt;# ) {&lt;br /&gt;
        $return_id = $1 if $1;&lt;br /&gt;
     }&lt;br /&gt;
   } else {&lt;br /&gt;
     # fail&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_1.3&amp;diff=11111</id>
		<title>SWORD 1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_1.3&amp;diff=11111"/>
		<updated>2015-01-21T14:58:15Z</updated>

		<summary type="html">&lt;p&gt;Kiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 1.3 is the only option in EPrints 3.2, and is available via an EPrints bazaar plugin in EPrints 3.3&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''mediation''' This is where one user can deposit ''on behalf of'' another user.&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Protocol implementation ==&lt;br /&gt;
&lt;br /&gt;
verbose&lt;br /&gt;
no-op&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
The default location for SWORD configuration is &lt;br /&gt;
&lt;br /&gt;
  archives/&amp;lt;your repo&amp;gt;/cfg/cfg.d/sword.pl&lt;br /&gt;
&lt;br /&gt;
This is where you enable and disable access to various ''collections'', and add/remove ''packages''&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of which &amp;quot;collections&amp;quot; are available, and what &amp;quot;packages&amp;quot; can be used with each one.&lt;br /&gt;
&lt;br /&gt;
* a &amp;quot;collection&amp;quot; in EPrints terms is &amp;lt;tt&amp;gt;inbox&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;review&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive&amp;lt;/tt&amp;gt; - which correspond to the users workspace, the administration review buffer, and visible in the live repository&lt;br /&gt;
* a &amp;quot;package&amp;quot; is an agreed method for wrapping up the data being sent over - as XML, as formatted text, in a zip file, etc...&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
   xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;OpenDepot.org&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/inbox&amp;quot;&amp;gt;&lt;br /&gt;
    .... &lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and in each collection is listed for package formats unsderstood:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;Repository Review&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;accept&amp;gt;*/*&amp;lt;/accept&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.loc.gov/METS/&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;1.0&amp;quot;&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.imsglobal.org/xsd/imscp_v1p1&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://purl.org/net/sword-types/METSDSpaceSIP&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:collectionPolicy/&amp;gt;&lt;br /&gt;
    &amp;lt;sword:treatment&amp;gt;&lt;br /&gt;
      Deposited items will undergo the review process. Upon approval, items will appear in the live repository.&lt;br /&gt;
    &amp;lt;/sword:treatment&amp;gt;&lt;br /&gt;
  &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
  &amp;lt;dcterms:abstract&amp;gt;This is the repository review.&amp;lt;/dcterms:abstract&amp;gt;&lt;br /&gt;
  &amp;lt;/collection&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.2, you need to create two things to enable a new importer&lt;br /&gt;
&lt;br /&gt;
# You need to configure the repository to recognise a new packagge format, and associate that format with the code that handles it&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# You need to write the actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/plugins/EPrints/plugin/Sword/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is relatively easy file to write - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Add in the RJ_Broker acceptance type&lt;br /&gt;
  $c-&amp;gt;{sword}-&amp;gt;{supported_packages}-&amp;gt;{&amp;quot;http://opendepot.org/broker/1.0&amp;quot;} = &lt;br /&gt;
  {&lt;br /&gt;
    name =&amp;gt; &amp;quot;Repository Junction Broker&amp;quot;,&lt;br /&gt;
    plugin =&amp;gt; &amp;quot;Sword::Import::RJ_Broker&amp;quot;,&lt;br /&gt;
    qvalue =&amp;gt; &amp;quot;0.8&amp;quot;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is the string that's shown in the servicedocument&lt;br /&gt;
* The &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; is the package used to handle the file deposited&lt;br /&gt;
* The &amp;lt;tt&amp;gt;qvalue&amp;lt;/tt&amp;gt; is what's known as the &amp;quot;Quality Value&amp;quot; - how closely the importer matches all the metadata wanted by the repository.&lt;br /&gt;
** The theory is that clients have a list of packages they can export as, and servers have a list of packages they understand - therefore a client can determine the best package for that transfer, based on relative QValues.&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt; is never run directly, and inherits most it its functions from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is another ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Sword/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Sword::Import::MyImporter;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Sword::Import;&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Sword::Import /;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sub new {&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;My Sword Importer&amp;quot;;&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is actually pretty useless as all it will do is create a blank record, with the deposited file attached as a document. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_file&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##        $opts{file} = $file;&lt;br /&gt;
##        $opts{mime_type} = $headers-&amp;gt;{content_type};&lt;br /&gt;
##        $opts{dataset_id} = $target_collection;&lt;br /&gt;
##        $opts{owner_id} = $owner-&amp;gt;get_id;&lt;br /&gt;
##        $opts{depositor_id} = $depositor-&amp;gt;get_id if(defined $depositor);&lt;br /&gt;
##        $opts{no_op}   = is this a No-op?&lt;br /&gt;
##        $opts{verbose} = is this verbosed?&lt;br /&gt;
sub input_file&lt;br /&gt;
{&lt;br /&gt;
    my ( $plugin, %opts) = @_;&lt;br /&gt;
&lt;br /&gt;
    my $session = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
    # needs to read the xml from the file:&lt;br /&gt;
    open my $fh, $file;&lt;br /&gt;
    my @xml = &amp;lt;$fh&amp;gt;;&lt;br /&gt;
    close $fh;&lt;br /&gt;
    my $xml = join '', @xml;&lt;br /&gt;
&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
    my $epdata = $plugin-&amp;gt;parse_xml($xml);&lt;br /&gt;
    my $eprint = $dataset-&amp;gt;create_object( $plugin-&amp;gt;{session}, $epdata );&lt;br /&gt;
    return $eprint;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub parse_xml&lt;br /&gt;
{&lt;br /&gt;
    my ($plugin, $xml) = @_;&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
&lt;br /&gt;
    #### do stuff&lt;br /&gt;
&lt;br /&gt;
    return $epdata;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Depositing (from Perl)==&lt;br /&gt;
&lt;br /&gt;
A SWORD deposit is, at its most basic level, just an HTTP POST request, so can be scripted fairly easily:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   # $ep is eprint to transfer&lt;br /&gt;
   my $ua = LWP::UserAgent-&amp;gt;new;&lt;br /&gt;
   my $auth = &amp;quot;Basic &amp;quot; . MIME::Base64::encode( &amp;quot;$username:$password&amp;quot;, '' );&lt;br /&gt;
&lt;br /&gt;
   my %headers = (&lt;br /&gt;
      'X-Packaging'         =&amp;gt; $package,              # eg: http://opendepot.org/broker/1.0&lt;br /&gt;
      'X-No-Op'             =&amp;gt; 'false',&lt;br /&gt;
      'X-Verbose'           =&amp;gt; 'true',&lt;br /&gt;
      'Content-Disposition' =&amp;gt; &amp;quot;filename=$filename&amp;quot;,  # The name of the &amp;quot;file&amp;quot; to be importer things its reading&lt;br /&gt;
      'Content-Type'        =&amp;gt; $mime,                 # eg: application/zip&lt;br /&gt;
      'User-Agent'          =&amp;gt; 'OA-RJ Broker v0.2',&lt;br /&gt;
      'Authorization'       =&amp;gt; $auth,&lt;br /&gt;
   );&lt;br /&gt;
   my $url    = &amp;quot;${host}${collection}&amp;quot;;&lt;br /&gt;
   my $buffer = $ep-&amp;gt;export($exporter) # eg BibTeX&lt;br /&gt;
&lt;br /&gt;
   my $r = $ua-&amp;gt;post( $url, %headers, Content =&amp;gt; $buffer );&lt;br /&gt;
   if ( $r-&amp;gt;is_success ) {&lt;br /&gt;
     # Transferred&lt;br /&gt;
     my $content = $r-&amp;gt;content;&lt;br /&gt;
     my $return_id;&lt;br /&gt;
     if ( $content =~ m#&amp;lt;atom:id&amp;gt;([^&amp;lt;]+)&amp;lt;/atom:id&amp;gt;# ) {&lt;br /&gt;
        $return_id = $1 if $1;&lt;br /&gt;
     }&lt;br /&gt;
   } else {&lt;br /&gt;
     # fail&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=11109</id>
		<title>SWORD 2.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=11109"/>
		<updated>2015-01-21T11:13:32Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Configuring SWORD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 2.0 is the default implimentation in EPrints 3.3, however there is a plugin to enable SWORD 1.3 (but see below)&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''content-type''' A ''mime-type'' (usually vendor specific) which the server recognises as triggering a particular process for handling the deposit process (very important in CRUD systems).&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;application/vnd.rjbroker&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
No configuration is required - SWORD 2.0 is enabled by default.&lt;br /&gt;
There are some caveats you need to be aware of:&lt;br /&gt;
* There is only one '''collection''': &amp;lt;code&amp;gt;/id/contents&amp;lt;/code&amp;gt;&lt;br /&gt;
** All updates are done by naming the specific eprint ID&lt;br /&gt;
* By default, new records are created in the &amp;quot;review&amp;quot; buffer&lt;br /&gt;
** If the incoming request has the '''In-Progress''' header element set true, then the deposit will be put into the &amp;lt;code&amp;gt;inbox&amp;lt;/code&amp;gt;&lt;br /&gt;
** If the repository has been configured to '''skip_buffer''' then items will be put into the &amp;lt;code&amp;gt;archive&amp;lt;/code&amp;gt; buffer rather than &amp;lt;code&amp;gt;review&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of what content-types (and packages) the server understands.&lt;br /&gt;
&lt;br /&gt;
It no longer lists Q-Values.&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' If you install the SWORD 1.3 plugin into EPrints 3.3, then &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt; returns the SWORD 1.3 configuration, not the SWORD 2.0 information.&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;br /&gt;
&amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
         xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;3.3.5: Manage deposits&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;sword:version&amp;gt;2.0&amp;lt;/sword:version&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://devel.edina.ac.uk:1202/id/contents&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;atom:title&amp;gt;Eprints&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
      &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/service&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the list of accepted content is given thus:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.eprints.data+xml; charset=utf-8&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/zip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/x-gzip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/SimpleZip&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats-officedocument.wordprocessingml.document&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/msword&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.rjbroker&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/Binary&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/octet-stream&amp;lt;/accept&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that there are a mixture of '''package''' and multi-part mime-types listed.&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.3, all importers are in the same place, there is no longer a distinction between &amp;quot;SWORD&amp;quot; and anything else.&lt;br /&gt;
&lt;br /&gt;
As with all non-core code, importers are in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import&amp;lt;/tt&amp;gt;. As this is global to all repositories (in fact, all perl packages were visible to all repos under 3.2 too... the joys of Mod-Perl) plugins under &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt; are disabled by default&lt;br /&gt;
&lt;br /&gt;
You can initially develop code in &amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt; however this is non-portable, and liable to get lost if (when!) you upgrade your installation of EPrints.&lt;br /&gt;
&lt;br /&gt;
Assuming you start out creating an EPrints Package, then you need to read [[My_First_Bazaar_Package]]&lt;br /&gt;
&lt;br /&gt;
# The actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
# You need to configure the specific repository to enable the new package&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/lib/epm/&amp;lt;Bazaar_package_name&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is simply an enabling statement - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Ensure the plugin is enabled&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{&amp;quot;Import::RJ_Broker_2&amp;quot;}-&amp;gt;{params}-&amp;gt;{disable} = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, whilst the actual perl package is Eprints/Plugin/Import/Foo.pm, and will be called &amp;lt;tt&amp;gt;EPrints::Plugin::Import::Foo&amp;lt;/tt&amp;gt;, the configuration file already knows its a plugin that's being enabled, so only needs &amp;lt;tt&amp;gt;Import::Foo&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is a ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Import::RJ_Broker_2;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Import::Binary;&lt;br /&gt;
use EPrints::Plugin::Import::Archive;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Import::Archive /;&lt;br /&gt;
&lt;br /&gt;
sub new &lt;br /&gt;
{&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
&lt;br /&gt;
  # The name to display&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Who can see it, and whether we show it&lt;br /&gt;
  $self-&amp;gt;{visible}   = &amp;quot;all&amp;quot;;&lt;br /&gt;
  $self-&amp;gt;{advertise} = 1;&lt;br /&gt;
&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This defines a few important things:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is the name to display in public&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
defines what the importer actually returns (some handle specific files [.pdf, .doc, .mp3], others may import several records in one go [eg EndNote files])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Defines what content-types andh/or package-types trigger the use of this importer.&lt;br /&gt;
(two importers registering to handle the same content-type is A bad Thing&amp;lt;sup&amp;gt;[tm]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whilst this is pretty, it's actually pretty useless as all it will do is replicate what &amp;lt;tt&amp;gt;Import::Archive&amp;lt;/tt&amp;gt; does. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_fh&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sub input_fh &lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, %opts ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $fh      = $opts{fh};&lt;br /&gt;
  my $dataset = $opts{dataset};&lt;br /&gt;
  my $repo    = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
  # get the type of file (should be zip) and the filename ($zipfile) for&lt;br /&gt;
  # the file just deposited.&lt;br /&gt;
  # (local method)&lt;br /&gt;
  my $zipfile = $plugin-&amp;gt;upload_archive($fh);&lt;br /&gt;
&lt;br /&gt;
  ## Do magic to get the XML file with the metadata&lt;br /&gt;
  my $epdata = $plugin-&amp;gt;parse_epdcx_xml_data($xml_data);&lt;br /&gt;
&lt;br /&gt;
  my $dataobj = $plugin-&amp;gt;epdata_to_dataobj( $dataset, $epdata );&lt;br /&gt;
  if ( defined $dataobj ) {&lt;br /&gt;
    push @ids, $dataobj-&amp;gt;get_id;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return EPrints::List-&amp;gt;new(&lt;br /&gt;
    dataset =&amp;gt; $dataset,&lt;br /&gt;
    session =&amp;gt; $repo,&lt;br /&gt;
    ids     =&amp;gt; \@ids&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub upload_archive &lt;br /&gt;
{&lt;br /&gt;
  my ( $self, $fh ) = @_;&lt;br /&gt;
&lt;br /&gt;
  use bytes;&lt;br /&gt;
&lt;br /&gt;
  binmode($fh);&lt;br /&gt;
&lt;br /&gt;
  my $zipfile = File::Temp-&amp;gt;new();&lt;br /&gt;
  binmode($zipfile);&lt;br /&gt;
&lt;br /&gt;
  my $rc;&lt;br /&gt;
  my $lead;&lt;br /&gt;
  while ( $rc = sysread( $fh, my $buffer, 4096 ) ) {&lt;br /&gt;
    $lead = $buffer if !defined $lead;&lt;br /&gt;
    syswrite( $zipfile, $buffer );&lt;br /&gt;
  }&lt;br /&gt;
  EPrints-&amp;gt;abort(&amp;quot;Error reading from file handle: $!&amp;quot;) if !defined $rc;&lt;br /&gt;
&lt;br /&gt;
  return $zipfile;&lt;br /&gt;
} ## end sub upload_archive&lt;br /&gt;
&lt;br /&gt;
sub parse_epdcx_xml_data&lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, $xml ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $epdata         = {};&lt;br /&gt;
 &lt;br /&gt;
  ## parse the XML as needed...&lt;br /&gt;
&lt;br /&gt;
  return $epdata;&lt;br /&gt;
} ## end sub parse_epdcx_xml_data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=11108</id>
		<title>SWORD 2.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=11108"/>
		<updated>2015-01-21T11:12:48Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Configuring SWORD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 2.0 is the default implimentation in EPrints 3.3, however there is a plugin to enable SWORD 1.3 (but see below)&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''content-type''' A ''mime-type'' (usually vendor specific) which the server recognises as triggering a particular process for handling the deposit process (very important in CRUD systems).&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;application/vnd.rjbroker&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
No configuration is required - SWORD 2.0 is enabled by default.&lt;br /&gt;
There are some caveats you need to be aware of:&lt;br /&gt;
* There is only one '''collection''': &amp;lt;code&amp;gt;/id/contents&amp;lt;/code&amp;gt;&lt;br /&gt;
** All updates are done by naming the specific eprint ID&lt;br /&gt;
* By default, new records are created in the &amp;quot;review&amp;quot; buffer&lt;br /&gt;
** If the incoming request has the '''In-Progress''' header element set true, then the deposit will be put into the &amp;quot;inbox&amp;quot;&lt;br /&gt;
** If the repository has been configured to '''skip_buffer''' then items will be put into the &amp;quot;archive&amp;quot; buffer rather than &amp;quot;review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of what content-types (and packages) the server understands.&lt;br /&gt;
&lt;br /&gt;
It no longer lists Q-Values.&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' If you install the SWORD 1.3 plugin into EPrints 3.3, then &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt; returns the SWORD 1.3 configuration, not the SWORD 2.0 information.&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;br /&gt;
&amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
         xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;3.3.5: Manage deposits&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;sword:version&amp;gt;2.0&amp;lt;/sword:version&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://devel.edina.ac.uk:1202/id/contents&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;atom:title&amp;gt;Eprints&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
      &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/service&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the list of accepted content is given thus:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.eprints.data+xml; charset=utf-8&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/zip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/x-gzip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/SimpleZip&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats-officedocument.wordprocessingml.document&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/msword&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.rjbroker&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/Binary&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/octet-stream&amp;lt;/accept&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that there are a mixture of '''package''' and multi-part mime-types listed.&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.3, all importers are in the same place, there is no longer a distinction between &amp;quot;SWORD&amp;quot; and anything else.&lt;br /&gt;
&lt;br /&gt;
As with all non-core code, importers are in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import&amp;lt;/tt&amp;gt;. As this is global to all repositories (in fact, all perl packages were visible to all repos under 3.2 too... the joys of Mod-Perl) plugins under &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt; are disabled by default&lt;br /&gt;
&lt;br /&gt;
You can initially develop code in &amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt; however this is non-portable, and liable to get lost if (when!) you upgrade your installation of EPrints.&lt;br /&gt;
&lt;br /&gt;
Assuming you start out creating an EPrints Package, then you need to read [[My_First_Bazaar_Package]]&lt;br /&gt;
&lt;br /&gt;
# The actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
# You need to configure the specific repository to enable the new package&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/lib/epm/&amp;lt;Bazaar_package_name&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is simply an enabling statement - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Ensure the plugin is enabled&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{&amp;quot;Import::RJ_Broker_2&amp;quot;}-&amp;gt;{params}-&amp;gt;{disable} = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, whilst the actual perl package is Eprints/Plugin/Import/Foo.pm, and will be called &amp;lt;tt&amp;gt;EPrints::Plugin::Import::Foo&amp;lt;/tt&amp;gt;, the configuration file already knows its a plugin that's being enabled, so only needs &amp;lt;tt&amp;gt;Import::Foo&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is a ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Import::RJ_Broker_2;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Import::Binary;&lt;br /&gt;
use EPrints::Plugin::Import::Archive;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Import::Archive /;&lt;br /&gt;
&lt;br /&gt;
sub new &lt;br /&gt;
{&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
&lt;br /&gt;
  # The name to display&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Who can see it, and whether we show it&lt;br /&gt;
  $self-&amp;gt;{visible}   = &amp;quot;all&amp;quot;;&lt;br /&gt;
  $self-&amp;gt;{advertise} = 1;&lt;br /&gt;
&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This defines a few important things:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is the name to display in public&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
defines what the importer actually returns (some handle specific files [.pdf, .doc, .mp3], others may import several records in one go [eg EndNote files])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Defines what content-types andh/or package-types trigger the use of this importer.&lt;br /&gt;
(two importers registering to handle the same content-type is A bad Thing&amp;lt;sup&amp;gt;[tm]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whilst this is pretty, it's actually pretty useless as all it will do is replicate what &amp;lt;tt&amp;gt;Import::Archive&amp;lt;/tt&amp;gt; does. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_fh&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sub input_fh &lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, %opts ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $fh      = $opts{fh};&lt;br /&gt;
  my $dataset = $opts{dataset};&lt;br /&gt;
  my $repo    = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
  # get the type of file (should be zip) and the filename ($zipfile) for&lt;br /&gt;
  # the file just deposited.&lt;br /&gt;
  # (local method)&lt;br /&gt;
  my $zipfile = $plugin-&amp;gt;upload_archive($fh);&lt;br /&gt;
&lt;br /&gt;
  ## Do magic to get the XML file with the metadata&lt;br /&gt;
  my $epdata = $plugin-&amp;gt;parse_epdcx_xml_data($xml_data);&lt;br /&gt;
&lt;br /&gt;
  my $dataobj = $plugin-&amp;gt;epdata_to_dataobj( $dataset, $epdata );&lt;br /&gt;
  if ( defined $dataobj ) {&lt;br /&gt;
    push @ids, $dataobj-&amp;gt;get_id;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return EPrints::List-&amp;gt;new(&lt;br /&gt;
    dataset =&amp;gt; $dataset,&lt;br /&gt;
    session =&amp;gt; $repo,&lt;br /&gt;
    ids     =&amp;gt; \@ids&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub upload_archive &lt;br /&gt;
{&lt;br /&gt;
  my ( $self, $fh ) = @_;&lt;br /&gt;
&lt;br /&gt;
  use bytes;&lt;br /&gt;
&lt;br /&gt;
  binmode($fh);&lt;br /&gt;
&lt;br /&gt;
  my $zipfile = File::Temp-&amp;gt;new();&lt;br /&gt;
  binmode($zipfile);&lt;br /&gt;
&lt;br /&gt;
  my $rc;&lt;br /&gt;
  my $lead;&lt;br /&gt;
  while ( $rc = sysread( $fh, my $buffer, 4096 ) ) {&lt;br /&gt;
    $lead = $buffer if !defined $lead;&lt;br /&gt;
    syswrite( $zipfile, $buffer );&lt;br /&gt;
  }&lt;br /&gt;
  EPrints-&amp;gt;abort(&amp;quot;Error reading from file handle: $!&amp;quot;) if !defined $rc;&lt;br /&gt;
&lt;br /&gt;
  return $zipfile;&lt;br /&gt;
} ## end sub upload_archive&lt;br /&gt;
&lt;br /&gt;
sub parse_epdcx_xml_data&lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, $xml ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $epdata         = {};&lt;br /&gt;
 &lt;br /&gt;
  ## parse the XML as needed...&lt;br /&gt;
&lt;br /&gt;
  return $epdata;&lt;br /&gt;
} ## end sub parse_epdcx_xml_data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10861</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10861"/>
		<updated>2013-10-22T09:48:18Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Mod-Perl */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png]]&lt;br /&gt;
&lt;br /&gt;
We will build the web server on a private computer called ''services.example.com'', running on port ''1234''; and the public access will be ''eprints.example.com'', on port ''80''&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod_perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: To install under Debian/Ubuntu, you will need the &amp;lt;code&amp;gt;libperl-dev&amp;lt;/code&amp;gt; package installed&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' In my install, all the &amp;lt;code&amp;gt;bin/&amp;lt;/code&amp;gt; files are installed with &amp;lt;code&amp;gt;/usr/bin/perl&amp;lt;/code&amp;gt;, not whatever's defined in the .configure statement - you may need to edit them!&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later) - so '''services.example.com'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later) - so '''1234'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf&lt;br /&gt;
&lt;br /&gt;
* Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section) - these are set on a per-repository basis&lt;br /&gt;
* Include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'eprints.example.com';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10858</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10858"/>
		<updated>2013-10-21T14:41:51Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Mod-Perl */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png]]&lt;br /&gt;
&lt;br /&gt;
We will build the web server on a private computer called ''services.example.com'', running on port ''1234''; and the public access will be ''eprints.example.com'', on port ''80''&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: To install under Debian/Ubuntu, you will need the &amp;lt;code&amp;gt;libperl-dev&amp;lt;/code&amp;gt; package installed&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' In my install, all the &amp;lt;code&amp;gt;bin/&amp;lt;/code&amp;gt; files are installed with &amp;lt;code&amp;gt;/usr/bin/perl&amp;lt;/code&amp;gt;, not whatever's defined in the .configure statement - you may need to edit them!&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later) - so '''services.example.com'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later) - so '''1234'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf&lt;br /&gt;
&lt;br /&gt;
* Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section) - these are set on a per-repository basis&lt;br /&gt;
* Include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'eprints.example.com';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=10857</id>
		<title>SWORD 2.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=10857"/>
		<updated>2013-10-21T09:25:17Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* servicedocument */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 2.0 is the default implimentation in EPrints 3.3, however there is a plugin to enable SWORD 1.3 (but see below)&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''content-type''' A ''mime-type'' (usually vendor specific) which the server recognises as triggering a particular process for handling the deposit process (very important in CRUD systems).&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;application/vnd.rjbroker&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
No configuration is required - SWORD 2.0 is enabled by default.&lt;br /&gt;
There are some caveats you need to be aware of:&lt;br /&gt;
* There is only one '''collection''': &amp;lt;code&amp;gt;/id/contents&amp;lt;/code&amp;gt;&lt;br /&gt;
** All updates are done by naming the specific eprint ID&lt;br /&gt;
* By default, new records are created in the public archive&lt;br /&gt;
* If a deposit has an issue (such as missing metadata fields flagged as ''required'') then the deposits are put into the review queue&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' - Need to work out how one uses &amp;quot;status&amp;quot; - can it direct a ''create'' into a particular buffer?)&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of what content-types (and packages) the server understands.&lt;br /&gt;
&lt;br /&gt;
It no longer lists Q-Values.&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' If you install the SWORD 1.3 plugin into EPrints 3.3, then &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt; returns the SWORD 1.3 configuration, not the SWORD 2.0 information.&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;br /&gt;
&amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
         xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;3.3.5: Manage deposits&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;sword:version&amp;gt;2.0&amp;lt;/sword:version&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://devel.edina.ac.uk:1202/id/contents&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;atom:title&amp;gt;Eprints&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
      &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/service&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the list of accepted content is given thus:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.eprints.data+xml; charset=utf-8&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/zip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/x-gzip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/SimpleZip&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats-officedocument.wordprocessingml.document&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/msword&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.rjbroker&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/Binary&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/octet-stream&amp;lt;/accept&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that there are a mixture of '''package''' and multi-part mime-types listed.&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.3, all importers are in the same place, there is no longer a distinction between &amp;quot;SWORD&amp;quot; and anything else.&lt;br /&gt;
&lt;br /&gt;
As with all non-core code, importers are in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import&amp;lt;/tt&amp;gt;. As this is global to all repositories (in fact, all perl packages were visible to all repos under 3.2 too... the joys of Mod-Perl) plugins under &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt; are disabled by default&lt;br /&gt;
&lt;br /&gt;
You can initially develop code in &amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt; however this is non-portable, and liable to get lost if (when!) you upgrade your installation of EPrints.&lt;br /&gt;
&lt;br /&gt;
Assuming you start out creating an EPrints Package, then you need to read [[My_First_Bazaar_Package]]&lt;br /&gt;
&lt;br /&gt;
# The actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
# You need to configure the specific repository to enable the new package&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/lib/epm/&amp;lt;Bazaar_package_name&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is simply an enabling statement - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Ensure the plugin is enabled&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{&amp;quot;Import::RJ_Broker_2&amp;quot;}-&amp;gt;{params}-&amp;gt;{disable} = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, whilst the actual perl package is Eprints/Plugin/Import/Foo.pm, and will be called &amp;lt;tt&amp;gt;EPrints::Plugin::Import::Foo&amp;lt;/tt&amp;gt;, the configuration file already knows its a plugin that's being enabled, so only needs &amp;lt;tt&amp;gt;Import::Foo&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is a ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Import::RJ_Broker_2;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Import::Binary;&lt;br /&gt;
use EPrints::Plugin::Import::Archive;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Import::Archive /;&lt;br /&gt;
&lt;br /&gt;
sub new &lt;br /&gt;
{&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
&lt;br /&gt;
  # The name to display&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Who can see it, and whether we show it&lt;br /&gt;
  $self-&amp;gt;{visible}   = &amp;quot;all&amp;quot;;&lt;br /&gt;
  $self-&amp;gt;{advertise} = 1;&lt;br /&gt;
&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This defines a few important things:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is the name to display in public&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
defines what the importer actually returns (some handle specific files [.pdf, .doc, .mp3], others may import several records in one go [eg EndNote files])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Defines what content-types andh/or package-types trigger the use of this importer.&lt;br /&gt;
(two importers registering to handle the same content-type is A bad Thing&amp;lt;sup&amp;gt;[tm]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whilst this is pretty, it's actually pretty useless as all it will do is replicate what &amp;lt;tt&amp;gt;Import::Archive&amp;lt;/tt&amp;gt; does. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_fh&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sub input_fh &lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, %opts ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $fh      = $opts{fh};&lt;br /&gt;
  my $dataset = $opts{dataset};&lt;br /&gt;
  my $repo    = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
  # get the type of file (should be zip) and the filename ($zipfile) for&lt;br /&gt;
  # the file just deposited.&lt;br /&gt;
  # (local method)&lt;br /&gt;
  my $zipfile = $plugin-&amp;gt;upload_archive($fh);&lt;br /&gt;
&lt;br /&gt;
  ## Do magic to get the XML file with the metadata&lt;br /&gt;
  my $epdata = $plugin-&amp;gt;parse_epdcx_xml_data($xml_data);&lt;br /&gt;
&lt;br /&gt;
  my $dataobj = $plugin-&amp;gt;epdata_to_dataobj( $dataset, $epdata );&lt;br /&gt;
  if ( defined $dataobj ) {&lt;br /&gt;
    push @ids, $dataobj-&amp;gt;get_id;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return EPrints::List-&amp;gt;new(&lt;br /&gt;
    dataset =&amp;gt; $dataset,&lt;br /&gt;
    session =&amp;gt; $repo,&lt;br /&gt;
    ids     =&amp;gt; \@ids&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub upload_archive &lt;br /&gt;
{&lt;br /&gt;
  my ( $self, $fh ) = @_;&lt;br /&gt;
&lt;br /&gt;
  use bytes;&lt;br /&gt;
&lt;br /&gt;
  binmode($fh);&lt;br /&gt;
&lt;br /&gt;
  my $zipfile = File::Temp-&amp;gt;new();&lt;br /&gt;
  binmode($zipfile);&lt;br /&gt;
&lt;br /&gt;
  my $rc;&lt;br /&gt;
  my $lead;&lt;br /&gt;
  while ( $rc = sysread( $fh, my $buffer, 4096 ) ) {&lt;br /&gt;
    $lead = $buffer if !defined $lead;&lt;br /&gt;
    syswrite( $zipfile, $buffer );&lt;br /&gt;
  }&lt;br /&gt;
  EPrints-&amp;gt;abort(&amp;quot;Error reading from file handle: $!&amp;quot;) if !defined $rc;&lt;br /&gt;
&lt;br /&gt;
  return $zipfile;&lt;br /&gt;
} ## end sub upload_archive&lt;br /&gt;
&lt;br /&gt;
sub parse_epdcx_xml_data&lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, $xml ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $epdata         = {};&lt;br /&gt;
 &lt;br /&gt;
  ## parse the XML as needed...&lt;br /&gt;
&lt;br /&gt;
  return $epdata;&lt;br /&gt;
} ## end sub parse_epdcx_xml_data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=10856</id>
		<title>SWORD 2.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=10856"/>
		<updated>2013-10-21T09:25:07Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* servicedocument */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 2.0 is the default implimentation in EPrints 3.3, however there is a plugin to enable SWORD 1.3 (but see below)&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''content-type''' A ''mime-type'' (usually vendor specific) which the server recognises as triggering a particular process for handling the deposit process (very important in CRUD systems).&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;application/vnd.rjbroker&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
No configuration is required - SWORD 2.0 is enabled by default.&lt;br /&gt;
There are some caveats you need to be aware of:&lt;br /&gt;
* There is only one '''collection''': &amp;lt;code&amp;gt;/id/contents&amp;lt;/code&amp;gt;&lt;br /&gt;
** All updates are done by naming the specific eprint ID&lt;br /&gt;
* By default, new records are created in the public archive&lt;br /&gt;
* If a deposit has an issue (such as missing metadata fields flagged as ''required'') then the deposits are put into the review queue&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' - Need to work out how one uses &amp;quot;status&amp;quot; - can it direct a ''create'' into a particular buffer?)&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of what content-types (and packages) the server understands.&lt;br /&gt;
&lt;br /&gt;
It no longer lists Q-Values.&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE'' If you install the SWORD 1.3 plugin into EPrints 3.3, then &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt; returns the SWORD 1.3 configuration, not the SWORD 2.0 information.&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;br /&gt;
&amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
         xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;3.3.5: Manage deposits&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;sword:version&amp;gt;2.0&amp;lt;/sword:version&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://devel.edina.ac.uk:1202/id/contents&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;atom:title&amp;gt;Eprints&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
      &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/service&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the list of accepted content is given thus:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.eprints.data+xml; charset=utf-8&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/zip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/x-gzip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/SimpleZip&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats-officedocument.wordprocessingml.document&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/msword&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.rjbroker&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/Binary&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/octet-stream&amp;lt;/accept&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that there are a mixture of '''package''' and multi-part mime-types listed.&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.3, all importers are in the same place, there is no longer a distinction between &amp;quot;SWORD&amp;quot; and anything else.&lt;br /&gt;
&lt;br /&gt;
As with all non-core code, importers are in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import&amp;lt;/tt&amp;gt;. As this is global to all repositories (in fact, all perl packages were visible to all repos under 3.2 too... the joys of Mod-Perl) plugins under &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt; are disabled by default&lt;br /&gt;
&lt;br /&gt;
You can initially develop code in &amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt; however this is non-portable, and liable to get lost if (when!) you upgrade your installation of EPrints.&lt;br /&gt;
&lt;br /&gt;
Assuming you start out creating an EPrints Package, then you need to read [[My_First_Bazaar_Package]]&lt;br /&gt;
&lt;br /&gt;
# The actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
# You need to configure the specific repository to enable the new package&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/lib/epm/&amp;lt;Bazaar_package_name&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is simply an enabling statement - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Ensure the plugin is enabled&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{&amp;quot;Import::RJ_Broker_2&amp;quot;}-&amp;gt;{params}-&amp;gt;{disable} = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, whilst the actual perl package is Eprints/Plugin/Import/Foo.pm, and will be called &amp;lt;tt&amp;gt;EPrints::Plugin::Import::Foo&amp;lt;/tt&amp;gt;, the configuration file already knows its a plugin that's being enabled, so only needs &amp;lt;tt&amp;gt;Import::Foo&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is a ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Import::RJ_Broker_2;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Import::Binary;&lt;br /&gt;
use EPrints::Plugin::Import::Archive;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Import::Archive /;&lt;br /&gt;
&lt;br /&gt;
sub new &lt;br /&gt;
{&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
&lt;br /&gt;
  # The name to display&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Who can see it, and whether we show it&lt;br /&gt;
  $self-&amp;gt;{visible}   = &amp;quot;all&amp;quot;;&lt;br /&gt;
  $self-&amp;gt;{advertise} = 1;&lt;br /&gt;
&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This defines a few important things:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is the name to display in public&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
defines what the importer actually returns (some handle specific files [.pdf, .doc, .mp3], others may import several records in one go [eg EndNote files])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Defines what content-types andh/or package-types trigger the use of this importer.&lt;br /&gt;
(two importers registering to handle the same content-type is A bad Thing&amp;lt;sup&amp;gt;[tm]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whilst this is pretty, it's actually pretty useless as all it will do is replicate what &amp;lt;tt&amp;gt;Import::Archive&amp;lt;/tt&amp;gt; does. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_fh&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sub input_fh &lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, %opts ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $fh      = $opts{fh};&lt;br /&gt;
  my $dataset = $opts{dataset};&lt;br /&gt;
  my $repo    = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
  # get the type of file (should be zip) and the filename ($zipfile) for&lt;br /&gt;
  # the file just deposited.&lt;br /&gt;
  # (local method)&lt;br /&gt;
  my $zipfile = $plugin-&amp;gt;upload_archive($fh);&lt;br /&gt;
&lt;br /&gt;
  ## Do magic to get the XML file with the metadata&lt;br /&gt;
  my $epdata = $plugin-&amp;gt;parse_epdcx_xml_data($xml_data);&lt;br /&gt;
&lt;br /&gt;
  my $dataobj = $plugin-&amp;gt;epdata_to_dataobj( $dataset, $epdata );&lt;br /&gt;
  if ( defined $dataobj ) {&lt;br /&gt;
    push @ids, $dataobj-&amp;gt;get_id;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return EPrints::List-&amp;gt;new(&lt;br /&gt;
    dataset =&amp;gt; $dataset,&lt;br /&gt;
    session =&amp;gt; $repo,&lt;br /&gt;
    ids     =&amp;gt; \@ids&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub upload_archive &lt;br /&gt;
{&lt;br /&gt;
  my ( $self, $fh ) = @_;&lt;br /&gt;
&lt;br /&gt;
  use bytes;&lt;br /&gt;
&lt;br /&gt;
  binmode($fh);&lt;br /&gt;
&lt;br /&gt;
  my $zipfile = File::Temp-&amp;gt;new();&lt;br /&gt;
  binmode($zipfile);&lt;br /&gt;
&lt;br /&gt;
  my $rc;&lt;br /&gt;
  my $lead;&lt;br /&gt;
  while ( $rc = sysread( $fh, my $buffer, 4096 ) ) {&lt;br /&gt;
    $lead = $buffer if !defined $lead;&lt;br /&gt;
    syswrite( $zipfile, $buffer );&lt;br /&gt;
  }&lt;br /&gt;
  EPrints-&amp;gt;abort(&amp;quot;Error reading from file handle: $!&amp;quot;) if !defined $rc;&lt;br /&gt;
&lt;br /&gt;
  return $zipfile;&lt;br /&gt;
} ## end sub upload_archive&lt;br /&gt;
&lt;br /&gt;
sub parse_epdcx_xml_data&lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, $xml ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $epdata         = {};&lt;br /&gt;
 &lt;br /&gt;
  ## parse the XML as needed...&lt;br /&gt;
&lt;br /&gt;
  return $epdata;&lt;br /&gt;
} ## end sub parse_epdcx_xml_data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=10855</id>
		<title>SWORD 2.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=10855"/>
		<updated>2013-10-21T08:44:11Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Basic framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 2.0 is the default implimentation in EPrints 3.3, however there is a plugin to enable SWORD 1.3 (but see below)&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''content-type''' A ''mime-type'' (usually vendor specific) which the server recognises as triggering a particular process for handling the deposit process (very important in CRUD systems).&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;application/vnd.rjbroker&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
No configuration is required - SWORD 2.0 is enabled by default.&lt;br /&gt;
There are some caveats you need to be aware of:&lt;br /&gt;
* There is only one '''collection''': &amp;lt;code&amp;gt;/id/contents&amp;lt;/code&amp;gt;&lt;br /&gt;
** All updates are done by naming the specific eprint ID&lt;br /&gt;
* By default, new records are created in the public archive&lt;br /&gt;
* If a deposit has an issue (such as missing metadata fields flagged as ''required'') then the deposits are put into the review queue&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' - Need to work out how one uses &amp;quot;status&amp;quot; - can it direct a ''create'' into a particular buffer?)&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of what content-types (and packages) the server understands.&lt;br /&gt;
&lt;br /&gt;
It no longer lists Q-Values.&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;br /&gt;
&amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
         xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;3.3.5: Manage deposits&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;sword:version&amp;gt;2.0&amp;lt;/sword:version&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://devel.edina.ac.uk:1202/id/contents&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;atom:title&amp;gt;Eprints&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
      &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/service&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the list of accepted content is given thus:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.eprints.data+xml; charset=utf-8&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/zip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/x-gzip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/SimpleZip&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats-officedocument.wordprocessingml.document&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/msword&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.rjbroker&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/Binary&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/octet-stream&amp;lt;/accept&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that there are a mixture of '''package''' and multi-part mime-types listed.&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.3, all importers are in the same place, there is no longer a distinction between &amp;quot;SWORD&amp;quot; and anything else.&lt;br /&gt;
&lt;br /&gt;
As with all non-core code, importers are in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import&amp;lt;/tt&amp;gt;. As this is global to all repositories (in fact, all perl packages were visible to all repos under 3.2 too... the joys of Mod-Perl) plugins under &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt; are disabled by default&lt;br /&gt;
&lt;br /&gt;
You can initially develop code in &amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt; however this is non-portable, and liable to get lost if (when!) you upgrade your installation of EPrints.&lt;br /&gt;
&lt;br /&gt;
Assuming you start out creating an EPrints Package, then you need to read [[My_First_Bazaar_Package]]&lt;br /&gt;
&lt;br /&gt;
# The actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
# You need to configure the specific repository to enable the new package&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/lib/epm/&amp;lt;Bazaar_package_name&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is simply an enabling statement - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Ensure the plugin is enabled&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{&amp;quot;Import::RJ_Broker_2&amp;quot;}-&amp;gt;{params}-&amp;gt;{disable} = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, whilst the actual perl package is Eprints/Plugin/Import/Foo.pm, and will be called &amp;lt;tt&amp;gt;EPrints::Plugin::Import::Foo&amp;lt;/tt&amp;gt;, the configuration file already knows its a plugin that's being enabled, so only needs &amp;lt;tt&amp;gt;Import::Foo&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is a ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Import::RJ_Broker_2;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Import::Binary;&lt;br /&gt;
use EPrints::Plugin::Import::Archive;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Import::Archive /;&lt;br /&gt;
&lt;br /&gt;
sub new &lt;br /&gt;
{&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
&lt;br /&gt;
  # The name to display&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Who can see it, and whether we show it&lt;br /&gt;
  $self-&amp;gt;{visible}   = &amp;quot;all&amp;quot;;&lt;br /&gt;
  $self-&amp;gt;{advertise} = 1;&lt;br /&gt;
&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This defines a few important things:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is the name to display in public&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
defines what the importer actually returns (some handle specific files [.pdf, .doc, .mp3], others may import several records in one go [eg EndNote files])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Defines what content-types andh/or package-types trigger the use of this importer.&lt;br /&gt;
(two importers registering to handle the same content-type is A bad Thing&amp;lt;sup&amp;gt;[tm]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whilst this is pretty, it's actually pretty useless as all it will do is replicate what &amp;lt;tt&amp;gt;Import::Archive&amp;lt;/tt&amp;gt; does. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_fh&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sub input_fh &lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, %opts ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $fh      = $opts{fh};&lt;br /&gt;
  my $dataset = $opts{dataset};&lt;br /&gt;
  my $repo    = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
  # get the type of file (should be zip) and the filename ($zipfile) for&lt;br /&gt;
  # the file just deposited.&lt;br /&gt;
  # (local method)&lt;br /&gt;
  my $zipfile = $plugin-&amp;gt;upload_archive($fh);&lt;br /&gt;
&lt;br /&gt;
  ## Do magic to get the XML file with the metadata&lt;br /&gt;
  my $epdata = $plugin-&amp;gt;parse_epdcx_xml_data($xml_data);&lt;br /&gt;
&lt;br /&gt;
  my $dataobj = $plugin-&amp;gt;epdata_to_dataobj( $dataset, $epdata );&lt;br /&gt;
  if ( defined $dataobj ) {&lt;br /&gt;
    push @ids, $dataobj-&amp;gt;get_id;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return EPrints::List-&amp;gt;new(&lt;br /&gt;
    dataset =&amp;gt; $dataset,&lt;br /&gt;
    session =&amp;gt; $repo,&lt;br /&gt;
    ids     =&amp;gt; \@ids&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub upload_archive &lt;br /&gt;
{&lt;br /&gt;
  my ( $self, $fh ) = @_;&lt;br /&gt;
&lt;br /&gt;
  use bytes;&lt;br /&gt;
&lt;br /&gt;
  binmode($fh);&lt;br /&gt;
&lt;br /&gt;
  my $zipfile = File::Temp-&amp;gt;new();&lt;br /&gt;
  binmode($zipfile);&lt;br /&gt;
&lt;br /&gt;
  my $rc;&lt;br /&gt;
  my $lead;&lt;br /&gt;
  while ( $rc = sysread( $fh, my $buffer, 4096 ) ) {&lt;br /&gt;
    $lead = $buffer if !defined $lead;&lt;br /&gt;
    syswrite( $zipfile, $buffer );&lt;br /&gt;
  }&lt;br /&gt;
  EPrints-&amp;gt;abort(&amp;quot;Error reading from file handle: $!&amp;quot;) if !defined $rc;&lt;br /&gt;
&lt;br /&gt;
  return $zipfile;&lt;br /&gt;
} ## end sub upload_archive&lt;br /&gt;
&lt;br /&gt;
sub parse_epdcx_xml_data&lt;br /&gt;
{&lt;br /&gt;
  my ( $plugin, $xml ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $epdata         = {};&lt;br /&gt;
 &lt;br /&gt;
  ## parse the XML as needed...&lt;br /&gt;
&lt;br /&gt;
  return $epdata;&lt;br /&gt;
} ## end sub parse_epdcx_xml_data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=10852</id>
		<title>SWORD 2.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=10852"/>
		<updated>2013-10-17T15:50:31Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 2.0 is the default implimentation in EPrints 3.3, however there is a plugin to enable SWORD 1.3 (but see below)&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''content-type''' A ''mime-type'' (usually vendor specific) which the server recognises as triggering a particular process for handling the deposit process (very important in CRUD systems).&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;application/vnd.rjbroker&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
No configuration is required - SWORD 2.0 is enabled by default.&lt;br /&gt;
There are some caveats you need to be aware of:&lt;br /&gt;
* There is only one '''collection''': &amp;lt;code&amp;gt;/id/contents&amp;lt;/code&amp;gt;&lt;br /&gt;
** All updates are done by naming the specific eprint ID&lt;br /&gt;
* By default, new records are created in the public archive&lt;br /&gt;
* If a deposit has an issue (such as missing metadata fields flagged as ''required'') then the deposits are put into the review queue&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' - Need to work out how one uses &amp;quot;status&amp;quot; - can it direct a ''create'' into a particular buffer?)&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of what content-types (and packages) the server understands.&lt;br /&gt;
&lt;br /&gt;
It no longer lists Q-Values.&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;br /&gt;
&amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
         xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;3.3.5: Manage deposits&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;sword:version&amp;gt;2.0&amp;lt;/sword:version&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://devel.edina.ac.uk:1202/id/contents&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;atom:title&amp;gt;Eprints&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
      &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/service&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the list of accepted content is given thus:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.eprints.data+xml; charset=utf-8&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/zip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/x-gzip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/SimpleZip&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats-officedocument.wordprocessingml.document&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/msword&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.rjbroker&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/Binary&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/octet-stream&amp;lt;/accept&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that there are a mixture of '''package''' and multi-part mime-types listed.&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.3, all importers are in the same place, there is no longer a distinction between &amp;quot;SWORD&amp;quot; and anything else.&lt;br /&gt;
&lt;br /&gt;
As with all non-core code, importers are in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import&amp;lt;/tt&amp;gt;. As this is global to all repositories (in fact, all perl packages were visible to all repos under 3.2 too... the joys of Mod-Perl) plugins under &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt; are disabled by default&lt;br /&gt;
&lt;br /&gt;
You can initially develop code in &amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt; however this is non-portable, and liable to get lost if (when!) you upgrade your installation of EPrints.&lt;br /&gt;
&lt;br /&gt;
Assuming you start out creating an EPrints Package, then you need to read [[My_First_Bazaar_Package]]&lt;br /&gt;
&lt;br /&gt;
# The actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
# You need to configure the specific repository to enable the new package&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/lib/epm/&amp;lt;Bazaar_package_name&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is simply an enabling statement - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Ensure the plugin is enabled&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{&amp;quot;Import::RJ_Broker_2&amp;quot;}-&amp;gt;{params}-&amp;gt;{disable} = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, whilst the actual perl package is Eprints/Plugin/Import/Foo.pm, and will be called &amp;lt;tt&amp;gt;EPrints::Plugin::Import::Foo&amp;lt;/tt&amp;gt;, the configuration file already knows its a plugin that's being enabled, so only needs &amp;lt;tt&amp;gt;Import::Foo&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is a ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Import::RJ_Broker_2;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Import::Binary;&lt;br /&gt;
use EPrints::Plugin::Import::Archive;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Import::Archive /;&lt;br /&gt;
&lt;br /&gt;
sub new {&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
&lt;br /&gt;
  # The name to display&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Who can see it, and whether we show it&lt;br /&gt;
  $self-&amp;gt;{visible}   = &amp;quot;all&amp;quot;;&lt;br /&gt;
  $self-&amp;gt;{advertise} = 1;&lt;br /&gt;
&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This defines a few important things:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is the name to display in public&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
defines what the importer actually returns (some handle specific files [.pdf, .doc, .mp3], others may import several records in one go [eg EndNote files])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Defines what content-types andh/or package-types trigger the use of this importer.&lt;br /&gt;
(two importers registering to handle the same content-type is A bad Thing&amp;lt;sup&amp;gt;[tm]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whilst this is pretty, it's actually pretty useless as all it will do is replicate what &amp;lt;tt&amp;gt;Import::Archive&amp;lt;/tt&amp;gt; does. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_fh&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sub input_fh {&lt;br /&gt;
  my ( $plugin, %opts ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $fh      = $opts{fh};&lt;br /&gt;
  my $dataset = $opts{dataset};&lt;br /&gt;
  my $repo    = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
  # get the type of file (should be zip) and the filename ($zipfile) for&lt;br /&gt;
  # the file just deposited.&lt;br /&gt;
  # (local method)&lt;br /&gt;
  my ( $type, $zipfile ) = $plugin-&amp;gt;upload_archive($fh);&lt;br /&gt;
&lt;br /&gt;
  ## Do magic to get the XML file with the metadata&lt;br /&gt;
  my $epdata = $plugin-&amp;gt;parse_epdcx_xml_data($xml_data);&lt;br /&gt;
&lt;br /&gt;
  my $dataobj = $plugin-&amp;gt;epdata_to_dataobj( $dataset, $epdata );&lt;br /&gt;
  if ( defined $dataobj ) {&lt;br /&gt;
    push @ids, $dataobj-&amp;gt;get_id;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return EPrints::List-&amp;gt;new(&lt;br /&gt;
    dataset =&amp;gt; $dataset,&lt;br /&gt;
    session =&amp;gt; $repo,&lt;br /&gt;
    ids     =&amp;gt; \@ids&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
## add in the upload_archive &amp;amp; arse_epdcx_xml_data methods&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=10851</id>
		<title>SWORD 2.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_2.0&amp;diff=10851"/>
		<updated>2013-10-17T15:50:00Z</updated>

		<summary type="html">&lt;p&gt;Kiz: Created page with 'SWORD 2.0 is the default implimentation in EPrints 3.3, however there is a plugin to enable SWORD 1.3 (but see below)  == Terminology ==  SWORD 2.0 uses some specific terms f…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 2.0 is the default implimentation in EPrints 3.3, however there is a plugin to enable SWORD 1.3 (but see below)&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''content-type''' A ''mime-type'' (usually vendor specific) which the server recognises as triggering a particular process for handling the deposit process (very important in CRUD systems).&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;application/vnd.rjbroker&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
No configuration is required - SWORD 2.0 is enabled by default.&lt;br /&gt;
There are some caveats you need to be aware of:&lt;br /&gt;
* There is only one '''collection''': &amp;lt;code&amp;gt;/id/contents&amp;lt;/code&amp;gt;&lt;br /&gt;
** All updates are done by naming the specific eprint ID&lt;br /&gt;
* By default, new records are created in the public archive&lt;br /&gt;
* If a deposit has an issue (such as missing metadata fields flagged as ''required'') then the deposits are put into the review queue&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' - Need to work out how one uses &amp;quot;status&amp;quot; - can it direct a ''create'' into a particular buffer?)&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of what content-types (and packages) the server understands.&lt;br /&gt;
&lt;br /&gt;
It no longer lists Q-Values.&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;br /&gt;
&amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot; xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;3.3.5: Manage deposits&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;sword:version&amp;gt;2.0&amp;lt;/sword:version&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://devel.edina.ac.uk:1202/id/contents&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;atom:title&amp;gt;Eprints&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
      &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/service&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and the list of accepted content is given thus:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.eprints.data+xml; charset=utf-8&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/zip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/x-gzip&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/SimpleZip&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats-officedocument.wordprocessingml.document&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.openxmlformats&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/msword&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/vnd.rjbroker&amp;lt;/accept&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;acceptPackaging&amp;gt;http://purl.org/net/sword/package/Binary&amp;lt;/acceptPackaging&amp;gt;&lt;br /&gt;
  &amp;lt;accept alternate=&amp;quot;multipart-related&amp;quot;&amp;gt;application/octet-stream&amp;lt;/accept&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that there are a mixture of '''package''' and multi-part mime-types listed.&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.3, all importers are in the same place, there is no longer a distinction between &amp;quot;SWORD&amp;quot; and anything else.&lt;br /&gt;
&lt;br /&gt;
As with all non-core code, importers are in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import&amp;lt;/tt&amp;gt;. As this is global to all repositories (in fact, all perl packages were visible to all repos under 3.2 too... the joys of Mod-Perl) plugins under &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt; are disabled by default&lt;br /&gt;
&lt;br /&gt;
You can initially develop code in &amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt; however this is non-portable, and liable to get lost if (when!) you upgrade your installation of EPrints.&lt;br /&gt;
&lt;br /&gt;
Assuming you start out creating an EPrints Package, then you need to read [[My_First_Bazaar_Package]]&lt;br /&gt;
&lt;br /&gt;
# The actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/lib/plugins/EPrints/Plugin/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
# You need to configure the specific repository to enable the new package&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/lib/epm/&amp;lt;Bazaar_package_name&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is simply an enabling statement - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Ensure the plugin is enabled&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{&amp;quot;Import::RJ_Broker_2&amp;quot;}-&amp;gt;{params}-&amp;gt;{disable} = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, whilst the actual perl package is Eprints/Plugin/Import/Foo.pm, and will be called &amp;lt;tt&amp;gt;EPrints::Plugin::Import::Foo&amp;lt;/tt&amp;gt;, the configuration file already knows its a plugin that's being enabled, so only needs &amp;lt;tt&amp;gt;Import::Foo&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is a ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Import::RJ_Broker_2;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Import::Binary;&lt;br /&gt;
use EPrints::Plugin::Import::Archive;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Import::Archive /;&lt;br /&gt;
&lt;br /&gt;
sub new {&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
&lt;br /&gt;
  # The name to display&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Who can see it, and whether we show it&lt;br /&gt;
  $self-&amp;gt;{visible}   = &amp;quot;all&amp;quot;;&lt;br /&gt;
  $self-&amp;gt;{advertise} = 1;&lt;br /&gt;
&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This defines a few important things:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;RJ_Broker package&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
is the name to display in public&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What the importer produces&lt;br /&gt;
  $self-&amp;gt;{produce} = [qw( list/eprint dataobj/eprint )];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
defines what the importer actually returns (some handle specific files [.pdf, .doc, .mp3], others may import several records in one go [eg EndNote files])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # What mime-types can trigger this importer&lt;br /&gt;
  $self-&amp;gt;{accept} = [ &amp;quot;application/vnd.rjbroker&amp;quot;,&lt;br /&gt;
    &amp;quot;sword:http://opendepot.org/broker/1.0&amp;quot; ];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Defines what content-types andh/or package-types trigger the use of this importer.&lt;br /&gt;
(two importers registering to handle the same content-type is A bad Thing&amp;lt;sup&amp;gt;[tm]&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whilst this is pretty, it's actually pretty useless as all it will do is replicate what &amp;lt;tt&amp;gt;Import::Archive&amp;lt;/tt&amp;gt; does. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_fh&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sub input_fh {&lt;br /&gt;
  my ( $plugin, %opts ) = @_;&lt;br /&gt;
&lt;br /&gt;
  my $fh      = $opts{fh};&lt;br /&gt;
  my $dataset = $opts{dataset};&lt;br /&gt;
  my $repo    = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
  # get the type of file (should be zip) and the filename ($zipfile) for&lt;br /&gt;
  # the file just deposited.&lt;br /&gt;
  # (local method)&lt;br /&gt;
  my ( $type, $zipfile ) = $plugin-&amp;gt;upload_archive($fh);&lt;br /&gt;
&lt;br /&gt;
  ## Do magic to get the XML file with the metadata&lt;br /&gt;
  my $epdata = $plugin-&amp;gt;parse_epdcx_xml_data($xml_data);&lt;br /&gt;
&lt;br /&gt;
  my $dataobj = $plugin-&amp;gt;epdata_to_dataobj( $dataset, $epdata );&lt;br /&gt;
  if ( defined $dataobj ) {&lt;br /&gt;
    push @ids, $dataobj-&amp;gt;get_id;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return EPrints::List-&amp;gt;new(&lt;br /&gt;
    dataset =&amp;gt; $dataset,&lt;br /&gt;
    session =&amp;gt; $repo,&lt;br /&gt;
    ids     =&amp;gt; \@ids&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
## add in the upload_archive &amp;amp; arse_epdcx_xml_data methods&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_1.3&amp;diff=10850</id>
		<title>SWORD 1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_1.3&amp;diff=10850"/>
		<updated>2013-10-17T14:52:44Z</updated>

		<summary type="html">&lt;p&gt;Kiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SWORD]] 1.3 is the only option in EPrints 3.2, and is available via an EPrints bazaar plugin in EPrints 3.3&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''mediation''' This is where one user can deposit ''on behalf of'' another user.&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Protocol implementation ==&lt;br /&gt;
&lt;br /&gt;
verbose&lt;br /&gt;
no-op&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
The default location for SWORD configuration is &lt;br /&gt;
&lt;br /&gt;
  archives/&amp;lt;your repo&amp;gt;/cfg/cfg.d/sword.pl&lt;br /&gt;
&lt;br /&gt;
This is where you enable and disable access to various ''collections'', and add/remove ''packages''&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of which &amp;quot;collections&amp;quot; are available, and what &amp;quot;packages&amp;quot; can be used with each one.&lt;br /&gt;
&lt;br /&gt;
* a &amp;quot;collection&amp;quot; in EPrints terms is &amp;lt;tt&amp;gt;inbox&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;review&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive&amp;lt;/tt&amp;gt; - which correspond to the users workspace, the administration review buffer, and visible in the live repository&lt;br /&gt;
* a &amp;quot;package&amp;quot; is an agreed method for wrapping up the data being sent over - as XML, as formatted text, in a zip file, etc...&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
   xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;OpenDepot.org&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/inbox&amp;quot;&amp;gt;&lt;br /&gt;
    .... &lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and in each collection is listed for package formats unsderstood:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;Repository Review&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;accept&amp;gt;*/*&amp;lt;/accept&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.loc.gov/METS/&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;1.0&amp;quot;&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.imsglobal.org/xsd/imscp_v1p1&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://purl.org/net/sword-types/METSDSpaceSIP&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:collectionPolicy/&amp;gt;&lt;br /&gt;
    &amp;lt;sword:treatment&amp;gt;&lt;br /&gt;
      Deposited items will undergo the review process. Upon approval, items will appear in the live repository.&lt;br /&gt;
    &amp;lt;/sword:treatment&amp;gt;&lt;br /&gt;
  &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
  &amp;lt;dcterms:abstract&amp;gt;This is the repository review.&amp;lt;/dcterms:abstract&amp;gt;&lt;br /&gt;
  &amp;lt;/collection&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.2, you need to create two things to enable a new importer&lt;br /&gt;
&lt;br /&gt;
# You need to configure the repository to recognise a new packagge format, and associate that format with the code that handles it&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# You need to write the actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/plugins/EPrints/plugin/Sword/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is relatively easy file to write - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Add in the RJ_Broker acceptance type&lt;br /&gt;
  $c-&amp;gt;{sword}-&amp;gt;{supported_packages}-&amp;gt;{&amp;quot;http://opendepot.org/broker/1.0&amp;quot;} = &lt;br /&gt;
  {&lt;br /&gt;
    name =&amp;gt; &amp;quot;Repository Junction Broker&amp;quot;,&lt;br /&gt;
    plugin =&amp;gt; &amp;quot;Sword::Import::RJ_Broker&amp;quot;,&lt;br /&gt;
    qvalue =&amp;gt; &amp;quot;0.8&amp;quot;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is the string that's shown in the servicedocument&lt;br /&gt;
* The &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; is the package used to handle the file deposited&lt;br /&gt;
* The &amp;lt;tt&amp;gt;qvalue&amp;lt;/tt&amp;gt; is what's known as the &amp;quot;Quality Value&amp;quot; - how closely the importer matches all the metadata wanted by the repository.&lt;br /&gt;
** The theory is that clients have a list of packages they can export as, and servers have a list of packages they understand - therefore a client can determine the best package for that transfer, based on relative QValues.&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt; is never run directly, and inherits most it its functions from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is another ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Sword/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Sword::Import::MyImporter;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Sword::Import;&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Sword::Import /;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sub new {&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;My Sword Importer&amp;quot;;&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is actually pretty useless as all it will do is create a blank record, with the deposited file attached as a document. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_file&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##        $opts{file} = $file;&lt;br /&gt;
##        $opts{mime_type} = $headers-&amp;gt;{content_type};&lt;br /&gt;
##        $opts{dataset_id} = $target_collection;&lt;br /&gt;
##        $opts{owner_id} = $owner-&amp;gt;get_id;&lt;br /&gt;
##        $opts{depositor_id} = $depositor-&amp;gt;get_id if(defined $depositor);&lt;br /&gt;
##        $opts{no_op}   = is this a No-op?&lt;br /&gt;
##        $opts{verbose} = is this verbosed?&lt;br /&gt;
sub input_file&lt;br /&gt;
{&lt;br /&gt;
    my ( $plugin, %opts) = @_;&lt;br /&gt;
&lt;br /&gt;
    my $session = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
    # needs to read the xml from the file:&lt;br /&gt;
    open my $fh, $file;&lt;br /&gt;
    my @xml = &amp;lt;$fh&amp;gt;;&lt;br /&gt;
    close $fh;&lt;br /&gt;
    my $xml = join '', @xml;&lt;br /&gt;
&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
    my $epdata = $plugin-&amp;gt;parse_xml($xml);&lt;br /&gt;
    my $eprint = $dataset-&amp;gt;create_object( $plugin-&amp;gt;{session}, $epdata );&lt;br /&gt;
    return $eprint;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub parse_xml&lt;br /&gt;
{&lt;br /&gt;
    my ($plugin, $xml) = @_;&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
&lt;br /&gt;
    #### do stuff&lt;br /&gt;
&lt;br /&gt;
    return $epdata;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD_1.3&amp;diff=10849</id>
		<title>SWORD 1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD_1.3&amp;diff=10849"/>
		<updated>2013-10-17T14:25:27Z</updated>

		<summary type="html">&lt;p&gt;Kiz: Created page with 'SWORD 1.3 is the only option in EPrints 3.2, and is available via an EPrints bazaar plugin in EPrints 3.3  == Terminology ==  SWORD 1.3 uses some specific terms for specific mean…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SWORD 1.3 is the only option in EPrints 3.2, and is available via an EPrints bazaar plugin in EPrints 3.3&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
** (eg &amp;lt;code&amp;gt;http://opendepot.org/broker/1.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
* '''mediation''' This is where one user can deposit ''on behalf of'' another user.&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Protocol implementation ==&lt;br /&gt;
&lt;br /&gt;
verbose&lt;br /&gt;
no-op&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
The default location for SWORD configuration is &lt;br /&gt;
&lt;br /&gt;
  archives/&amp;lt;your repo&amp;gt;/cfg/cfg.d/sword.pl&lt;br /&gt;
&lt;br /&gt;
This is where you enable and disable access to various ''collections'', and add/remove ''packages''&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of which &amp;quot;collections&amp;quot; are available, and what &amp;quot;packages&amp;quot; can be used with each one.&lt;br /&gt;
&lt;br /&gt;
* a &amp;quot;collection&amp;quot; in EPrints terms is &amp;lt;tt&amp;gt;inbox&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;review&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive&amp;lt;/tt&amp;gt; - which correspond to the users workspace, the administration review buffer, and visible in the live repository&lt;br /&gt;
* a &amp;quot;package&amp;quot; is an agreed method for wrapping up the data being sent over - as XML, as formatted text, in a zip file, etc...&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
   xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;OpenDepot.org&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/inbox&amp;quot;&amp;gt;&lt;br /&gt;
    .... &lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and in each collection is listed for package formats unsderstood:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;Repository Review&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;accept&amp;gt;*/*&amp;lt;/accept&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.loc.gov/METS/&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;1.0&amp;quot;&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.imsglobal.org/xsd/imscp_v1p1&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://purl.org/net/sword-types/METSDSpaceSIP&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:collectionPolicy/&amp;gt;&lt;br /&gt;
    &amp;lt;sword:treatment&amp;gt;&lt;br /&gt;
      Deposited items will undergo the review process. Upon approval, items will appear in the live repository.&lt;br /&gt;
    &amp;lt;/sword:treatment&amp;gt;&lt;br /&gt;
  &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
  &amp;lt;dcterms:abstract&amp;gt;This is the repository review.&amp;lt;/dcterms:abstract&amp;gt;&lt;br /&gt;
  &amp;lt;/collection&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.2, you need to create two things to enable a new importer&lt;br /&gt;
&lt;br /&gt;
# You need to configure the repository to recognise a new packagge format, and associate that format with the code that handles it&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# You need to write the actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/plugins/EPrints/plugin/Sword/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is relatively easy file to write - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Add in the RJ_Broker acceptance type&lt;br /&gt;
  $c-&amp;gt;{sword}-&amp;gt;{supported_packages}-&amp;gt;{&amp;quot;http://opendepot.org/broker/1.0&amp;quot;} = &lt;br /&gt;
  {&lt;br /&gt;
    name =&amp;gt; &amp;quot;Repository Junction Broker&amp;quot;,&lt;br /&gt;
    plugin =&amp;gt; &amp;quot;Sword::Import::RJ_Broker&amp;quot;,&lt;br /&gt;
    qvalue =&amp;gt; &amp;quot;0.8&amp;quot;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is the string that's shown in the servicedocument&lt;br /&gt;
* The &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; is the package used to handle the file deposited&lt;br /&gt;
* The &amp;lt;tt&amp;gt;qvalue&amp;lt;/tt&amp;gt; is what's known as the &amp;quot;Quality Value&amp;quot; - how closely the importer matches all the metadata wanted by the repository.&lt;br /&gt;
** The theory is that clients have a list of packages they can export as, and servers have a list of packages they understand - therefore a client can determine the best package for that transfer, based on relative QValues.&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt; is never run directly, and inherits most it its functions from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is another ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Sword/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Sword::Import::MyImporter;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Sword::Import;&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Sword::Import /;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sub new {&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;My Sword Importer&amp;quot;;&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is actually pretty useless as all it will do is create a blank record, with the deposited file attached as a document. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_file&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##        $opts{file} = $file;&lt;br /&gt;
##        $opts{mime_type} = $headers-&amp;gt;{content_type};&lt;br /&gt;
##        $opts{dataset_id} = $target_collection;&lt;br /&gt;
##        $opts{owner_id} = $owner-&amp;gt;get_id;&lt;br /&gt;
##        $opts{depositor_id} = $depositor-&amp;gt;get_id if(defined $depositor);&lt;br /&gt;
##        $opts{no_op}   = is this a No-op?&lt;br /&gt;
##        $opts{verbose} = is this verbosed?&lt;br /&gt;
sub input_file&lt;br /&gt;
{&lt;br /&gt;
    my ( $plugin, %opts) = @_;&lt;br /&gt;
&lt;br /&gt;
    my $session = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
    # needs to read the xml from the file:&lt;br /&gt;
    open my $fh, $file;&lt;br /&gt;
    my @xml = &amp;lt;$fh&amp;gt;;&lt;br /&gt;
    close $fh;&lt;br /&gt;
    my $xml = join '', @xml;&lt;br /&gt;
&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
    my $epdata = $plugin-&amp;gt;parse_xml($xml);&lt;br /&gt;
    my $eprint = $dataset-&amp;gt;create_object( $plugin-&amp;gt;{session}, $epdata );&lt;br /&gt;
    return $eprint;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub parse_xml&lt;br /&gt;
{&lt;br /&gt;
    my ($plugin, $xml) = @_;&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
&lt;br /&gt;
    #### do stuff&lt;br /&gt;
&lt;br /&gt;
    return $epdata;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10848</id>
		<title>SWORD</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10848"/>
		<updated>2013-10-17T14:22:50Z</updated>

		<summary type="html">&lt;p&gt;Kiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints 3 Plugins]]&lt;br /&gt;
This page is about SWORD which is a lightweight protocol for remotely depositing content into repositories.&lt;br /&gt;
&lt;br /&gt;
The SWORD project was funded by [http://www.jisc.ac.uk/ JISC] and more information can be found on the [http://swordapp.org official website].&lt;br /&gt;
&lt;br /&gt;
== SWORD made easy ==&lt;br /&gt;
&lt;br /&gt;
SWORD is basically an http put (or '''POST''') to a defined web URL, where the content of the posted request is the thing being deposited.&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses an http header field to define how the ''thing'' has been wrapped up ('''packaged''')&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses the content-type to deduce how to understand ''thing''&lt;br /&gt;
&lt;br /&gt;
By default, sword is ENABLED in all SWORD 3.2 &amp;amp; 3.3 EPrints servers, and access is available to all registered users.&lt;br /&gt;
&lt;br /&gt;
EPrints 3.2 uses [[SWORD 1.3]]&lt;br /&gt;
&lt;br /&gt;
EPrints 3.3 uses [[SWORD 2.0]]&lt;br /&gt;
&lt;br /&gt;
For further information on SWORD 2 see [[API:EPrints/Apache/CRUD]].&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10842</id>
		<title>SWORD</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10842"/>
		<updated>2013-10-14T07:41:49Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Importer Plugin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints 3 Plugins]]&lt;br /&gt;
This page is about SWORD which is a lightweight protocol for remotely depositing content into repositories.&lt;br /&gt;
&lt;br /&gt;
The SWORD project was funded by [http://www.jisc.ac.uk/ JISC] and more information can be found on the [http://swordapp.org official website].&lt;br /&gt;
&lt;br /&gt;
== SWORD made easy ==&lt;br /&gt;
&lt;br /&gt;
SWORD is basically an http put (or '''POST''') to a defined web URL, where the content of the posted request is the thing being deposited.&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses an http header field to define how the ''thing'' has been wrapped up ('''packaged''')&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses the content-type to deduce how to understand ''thing''&lt;br /&gt;
&lt;br /&gt;
By default, sword is ENABLED in all SWORD 3.2 &amp;amp; 3.3 EPrints servers, and access is available to all registered users.&lt;br /&gt;
&lt;br /&gt;
EPrints 3.2 uses SWORD 1.3&lt;br /&gt;
&lt;br /&gt;
EPrints 3.3 uses SWORD 2.0&lt;br /&gt;
&lt;br /&gt;
This document covers EPrints 3.2 &amp;amp; SWORD 1.3&lt;br /&gt;
For information on SWORD 2 see [[API:EPrints/Apache/CRUD]].&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
* '''mediation''' This is where one user can deposit ''on behalf of'' another user.&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Protocol implementation ==&lt;br /&gt;
&lt;br /&gt;
verbose&lt;br /&gt;
no-op&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default location for SWORD configuration is &lt;br /&gt;
&lt;br /&gt;
  archives/&amp;lt;your repo&amp;gt;/cfg/cfg.d/sword.pl&lt;br /&gt;
&lt;br /&gt;
This is where you enable and disable access to various ''collections'', and add/remove ''packages''&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of which &amp;quot;collections&amp;quot; are available, and what &amp;quot;packages&amp;quot; can be used with each one.&lt;br /&gt;
&lt;br /&gt;
* a &amp;quot;collection&amp;quot; in EPrints terms is &amp;lt;tt&amp;gt;inbox&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;review&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive&amp;lt;/tt&amp;gt; - which correspond to the users workspace, the administration review buffer, and visible in the live repository&lt;br /&gt;
* a &amp;quot;package&amp;quot; is an agreed method for wrapping up the data being sent over - as XML, as formatted text, in a zip file, etc...&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
   xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;OpenDepot.org&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/inbox&amp;quot;&amp;gt;&lt;br /&gt;
    .... &lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and in each collection is listed for package formats unsderstood:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;Repository Review&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;accept&amp;gt;*/*&amp;lt;/accept&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.loc.gov/METS/&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;1.0&amp;quot;&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.imsglobal.org/xsd/imscp_v1p1&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://purl.org/net/sword-types/METSDSpaceSIP&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:collectionPolicy/&amp;gt;&lt;br /&gt;
    &amp;lt;sword:treatment&amp;gt;&lt;br /&gt;
      Deposited items will undergo the review process. Upon approval, items will appear in the live repository.&lt;br /&gt;
    &amp;lt;/sword:treatment&amp;gt;&lt;br /&gt;
  &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
  &amp;lt;dcterms:abstract&amp;gt;This is the repository review.&amp;lt;/dcterms:abstract&amp;gt;&lt;br /&gt;
  &amp;lt;/collection&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.2, you need to create two things to enable a new importer&lt;br /&gt;
&lt;br /&gt;
# You need to configure the repository to recognise a new packagge format, and associate that format with the code that handles it&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# You need to write the actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/plugins/EPrints/plugin/Sword/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is relatively easy file to write - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Add in the RJ_Broker acceptance type&lt;br /&gt;
  $c-&amp;gt;{sword}-&amp;gt;{supported_packages}-&amp;gt;{&amp;quot;http://opendepot.org/broker/1.0&amp;quot;} = &lt;br /&gt;
  {&lt;br /&gt;
    name =&amp;gt; &amp;quot;Repository Junction Broker&amp;quot;,&lt;br /&gt;
    plugin =&amp;gt; &amp;quot;Sword::Import::RJ_Broker&amp;quot;,&lt;br /&gt;
    qvalue =&amp;gt; &amp;quot;0.8&amp;quot;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is the string that's shown in the servicedocument&lt;br /&gt;
* The &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; is the package used to handle the file deposited&lt;br /&gt;
* The &amp;lt;tt&amp;gt;qvalue&amp;lt;/tt&amp;gt; is what's known as the &amp;quot;Quality Value&amp;quot; - how closely the importer matches all the metadata wanted by the repository.&lt;br /&gt;
** The theory is that clients have a list of packages they can export as, and servers have a list of packages they understand - therefore a client can determine the best package for that transfer, based on relative QValues.&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
The Importer system is, as with all EPrints code, deeply hierarchical:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import::MyImporter&amp;lt;/code&amp;gt; will inherit most of its code from &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Sword::Import&amp;lt;/code&amp;gt; is never run directly, and inherits most it its functions from &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin::Import&amp;lt;/code&amp;gt; is another ''base class'' (one that is there to provide central functions), and inherits from &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;EPrints::Plugin&amp;lt;/code&amp;gt; is the ''base class'' for all plugins.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Sword/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is just to register the importer with EPrints, and leave all functions to be handled by inheritence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Sword::Import::MyImporter;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Sword::Import;&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Sword::Import /;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sub new {&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;My Sword Importer&amp;quot;;&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is actually pretty useless as all it will do is create a blank record, with the deposited file attached as a document. To be useful, it needs to somehow read in some metadata and maybe attach some files.&lt;br /&gt;
&lt;br /&gt;
The first important task will be to handle the file deposited. For this, you need to create a function called &amp;lt;code&amp;gt;input_file&amp;lt;/code&amp;gt;, and it will have a framework something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##        $opts{file} = $file;&lt;br /&gt;
##        $opts{mime_type} = $headers-&amp;gt;{content_type};&lt;br /&gt;
##        $opts{dataset_id} = $target_collection;&lt;br /&gt;
##        $opts{owner_id} = $owner-&amp;gt;get_id;&lt;br /&gt;
##        $opts{depositor_id} = $depositor-&amp;gt;get_id if(defined $depositor);&lt;br /&gt;
##        $opts{no_op}   = is this a No-op?&lt;br /&gt;
##        $opts{verbose} = is this verbosed?&lt;br /&gt;
sub input_file&lt;br /&gt;
{&lt;br /&gt;
    my ( $plugin, %opts) = @_;&lt;br /&gt;
&lt;br /&gt;
    my $session = $plugin-&amp;gt;{session};&lt;br /&gt;
&lt;br /&gt;
    # needs to read the xml from the file:&lt;br /&gt;
    open my $fh, $file;&lt;br /&gt;
    my @xml = &amp;lt;$fh&amp;gt;;&lt;br /&gt;
    close $fh;&lt;br /&gt;
    my $xml = join '', @xml;&lt;br /&gt;
&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
    my $epdata = $plugin-&amp;gt;parse_xml($xml);&lt;br /&gt;
    my $eprint = $dataset-&amp;gt;create_object( $plugin-&amp;gt;{session}, $epdata );&lt;br /&gt;
    return $eprint;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub parse_xml&lt;br /&gt;
{&lt;br /&gt;
    my ($plugin, $xml) = @_;&lt;br /&gt;
    my $epdata = {};&lt;br /&gt;
&lt;br /&gt;
    #### do stuff&lt;br /&gt;
&lt;br /&gt;
    return $epdata;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10841</id>
		<title>SWORD</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10841"/>
		<updated>2013-10-11T15:38:09Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Writing your own Importer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints 3 Plugins]]&lt;br /&gt;
This page is about SWORD which is a lightweight protocol for remotely depositing content into repositories.&lt;br /&gt;
&lt;br /&gt;
The SWORD project was funded by [http://www.jisc.ac.uk/ JISC] and more information can be found on the [http://swordapp.org official website].&lt;br /&gt;
&lt;br /&gt;
== SWORD made easy ==&lt;br /&gt;
&lt;br /&gt;
SWORD is basically an http put (or '''POST''') to a defined web URL, where the content of the posted request is the thing being deposited.&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses an http header field to define how the ''thing'' has been wrapped up ('''packaged''')&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses the content-type to deduce how to understand ''thing''&lt;br /&gt;
&lt;br /&gt;
By default, sword is ENABLED in all SWORD 3.2 &amp;amp; 3.3 EPrints servers, and access is available to all registered users.&lt;br /&gt;
&lt;br /&gt;
EPrints 3.2 uses SWORD 1.3&lt;br /&gt;
&lt;br /&gt;
EPrints 3.3 uses SWORD 2.0&lt;br /&gt;
&lt;br /&gt;
This document covers EPrints 3.2 &amp;amp; SWORD 1.3&lt;br /&gt;
For information on SWORD 2 see [[API:EPrints/Apache/CRUD]].&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
* '''mediation''' This is where one user can deposit ''on behalf of'' another user.&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Protocol implementation ==&lt;br /&gt;
&lt;br /&gt;
verbose&lt;br /&gt;
no-op&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default location for SWORD configuration is &lt;br /&gt;
&lt;br /&gt;
  archives/&amp;lt;your repo&amp;gt;/cfg/cfg.d/sword.pl&lt;br /&gt;
&lt;br /&gt;
This is where you enable and disable access to various ''collections'', and add/remove ''packages''&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of which &amp;quot;collections&amp;quot; are available, and what &amp;quot;packages&amp;quot; can be used with each one.&lt;br /&gt;
&lt;br /&gt;
* a &amp;quot;collection&amp;quot; in EPrints terms is &amp;lt;tt&amp;gt;inbox&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;review&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive&amp;lt;/tt&amp;gt; - which correspond to the users workspace, the administration review buffer, and visible in the live repository&lt;br /&gt;
* a &amp;quot;package&amp;quot; is an agreed method for wrapping up the data being sent over - as XML, as formatted text, in a zip file, etc...&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
   xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;OpenDepot.org&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/inbox&amp;quot;&amp;gt;&lt;br /&gt;
    .... &lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and in each collection is listed for package formats unsderstood:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;Repository Review&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;accept&amp;gt;*/*&amp;lt;/accept&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.loc.gov/METS/&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;1.0&amp;quot;&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.imsglobal.org/xsd/imscp_v1p1&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://purl.org/net/sword-types/METSDSpaceSIP&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:collectionPolicy/&amp;gt;&lt;br /&gt;
    &amp;lt;sword:treatment&amp;gt;&lt;br /&gt;
      Deposited items will undergo the review process. Upon approval, items will appear in the live repository.&lt;br /&gt;
    &amp;lt;/sword:treatment&amp;gt;&lt;br /&gt;
  &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
  &amp;lt;dcterms:abstract&amp;gt;This is the repository review.&amp;lt;/dcterms:abstract&amp;gt;&lt;br /&gt;
  &amp;lt;/collection&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.2, you need to create two things to enable a new importer&lt;br /&gt;
&lt;br /&gt;
# You need to configure the repository to recognise a new packagge format, and associate that format with the code that handles it&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# You need to write the actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/plugins/EPrints/plugin/Sword/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is relatively easy file to write - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Add in the RJ_Broker acceptance type&lt;br /&gt;
  $c-&amp;gt;{sword}-&amp;gt;{supported_packages}-&amp;gt;{&amp;quot;http://opendepot.org/broker/1.0&amp;quot;} = &lt;br /&gt;
  {&lt;br /&gt;
    name =&amp;gt; &amp;quot;Repository Junction Broker&amp;quot;,&lt;br /&gt;
    plugin =&amp;gt; &amp;quot;Sword::Import::RJ_Broker&amp;quot;,&lt;br /&gt;
    qvalue =&amp;gt; &amp;quot;0.8&amp;quot;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is the string that's shown in the servicedocument&lt;br /&gt;
* The &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; is the package used to handle the file deposited&lt;br /&gt;
* The &amp;lt;tt&amp;gt;qvalue&amp;lt;/tt&amp;gt; is what's known as the &amp;quot;Quality Value&amp;quot; - how closely the importer matches all the metadata wanted by the repository.&lt;br /&gt;
** The theory is that clients have a list of packages they can export as, and servers have a list of packages they understand - therefore a client can determine the best package for that transfer, based on relative QValues.&lt;br /&gt;
&lt;br /&gt;
=== Importer Plugin ===&lt;br /&gt;
The importer plugin is a perl package that handles the deposited file, and creates a new record in the repository for the record deposited.&lt;br /&gt;
&lt;br /&gt;
In practice, the best way to learn how importers are written is to look at existing importers (&amp;lt;tt&amp;gt;~~eprints/perl-lib/EPrints/Plugin/Sword/Import/...&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==== Basic framework ====&lt;br /&gt;
The very basic framework for an importer is to subclass from the generic &amp;quot;import&amp;quot; class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package EPrints::Plugin::Sword::Import::MyImporter;&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
use EPrints::Plugin::Sword::Import;&lt;br /&gt;
our @ISA = qw/ EPrints::Plugin::Sword::Import /;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sub new {&lt;br /&gt;
  my ( $class, %params ) = @_;&lt;br /&gt;
  my $self = $class-&amp;gt;SUPER::new(%params);&lt;br /&gt;
  $self-&amp;gt;{name} = &amp;quot;My Sword Importer&amp;quot;;&lt;br /&gt;
  return $self;&lt;br /&gt;
} ## end sub new&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10840</id>
		<title>SWORD</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10840"/>
		<updated>2013-10-11T15:30:39Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Supported packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints 3 Plugins]]&lt;br /&gt;
This page is about SWORD which is a lightweight protocol for remotely depositing content into repositories.&lt;br /&gt;
&lt;br /&gt;
The SWORD project was funded by [http://www.jisc.ac.uk/ JISC] and more information can be found on the [http://swordapp.org official website].&lt;br /&gt;
&lt;br /&gt;
== SWORD made easy ==&lt;br /&gt;
&lt;br /&gt;
SWORD is basically an http put (or '''POST''') to a defined web URL, where the content of the posted request is the thing being deposited.&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses an http header field to define how the ''thing'' has been wrapped up ('''packaged''')&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses the content-type to deduce how to understand ''thing''&lt;br /&gt;
&lt;br /&gt;
By default, sword is ENABLED in all SWORD 3.2 &amp;amp; 3.3 EPrints servers, and access is available to all registered users.&lt;br /&gt;
&lt;br /&gt;
EPrints 3.2 uses SWORD 1.3&lt;br /&gt;
&lt;br /&gt;
EPrints 3.3 uses SWORD 2.0&lt;br /&gt;
&lt;br /&gt;
This document covers EPrints 3.2 &amp;amp; SWORD 1.3&lt;br /&gt;
For information on SWORD 2 see [[API:EPrints/Apache/CRUD]].&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
* '''mediation''' This is where one user can deposit ''on behalf of'' another user.&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Protocol implementation ==&lt;br /&gt;
&lt;br /&gt;
verbose&lt;br /&gt;
no-op&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default location for SWORD configuration is &lt;br /&gt;
&lt;br /&gt;
  archives/&amp;lt;your repo&amp;gt;/cfg/cfg.d/sword.pl&lt;br /&gt;
&lt;br /&gt;
This is where you enable and disable access to various ''collections'', and add/remove ''packages''&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of which &amp;quot;collections&amp;quot; are available, and what &amp;quot;packages&amp;quot; can be used with each one.&lt;br /&gt;
&lt;br /&gt;
* a &amp;quot;collection&amp;quot; in EPrints terms is &amp;lt;tt&amp;gt;inbox&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;review&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive&amp;lt;/tt&amp;gt; - which correspond to the users workspace, the administration review buffer, and visible in the live repository&lt;br /&gt;
* a &amp;quot;package&amp;quot; is an agreed method for wrapping up the data being sent over - as XML, as formatted text, in a zip file, etc...&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
   xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;OpenDepot.org&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/inbox&amp;quot;&amp;gt;&lt;br /&gt;
    .... &lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and in each collection is listed for package formats unsderstood:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;Repository Review&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;accept&amp;gt;*/*&amp;lt;/accept&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.loc.gov/METS/&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;1.0&amp;quot;&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.imsglobal.org/xsd/imscp_v1p1&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://purl.org/net/sword-types/METSDSpaceSIP&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:collectionPolicy/&amp;gt;&lt;br /&gt;
    &amp;lt;sword:treatment&amp;gt;&lt;br /&gt;
      Deposited items will undergo the review process. Upon approval, items will appear in the live repository.&lt;br /&gt;
    &amp;lt;/sword:treatment&amp;gt;&lt;br /&gt;
  &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
  &amp;lt;dcterms:abstract&amp;gt;This is the repository review.&amp;lt;/dcterms:abstract&amp;gt;&lt;br /&gt;
  &amp;lt;/collection&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Writing your own Importer ==&lt;br /&gt;
&lt;br /&gt;
In EPrints 3.2, you need to create two things to enable a new importer&lt;br /&gt;
&lt;br /&gt;
# You need to configure the repository to recognise a new packagge format, and associate that format with the code that handles it&lt;br /&gt;
** This lives in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/cfg.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
# You need to write the actual package that handles the file being deposited&lt;br /&gt;
** This live in &amp;lt;tt&amp;gt;~~eprints/archives/&amp;lt;ID&amp;gt;/cfg/plugins/EPrints/plugin/Sword/Import/&amp;lt;/tt&amp;gt;&lt;br /&gt;
** For complex importers, you may end up writing multiple packages - its Perl.... TMTOWTDI&lt;br /&gt;
&lt;br /&gt;
=== Configuration file ===&lt;br /&gt;
This is relatively easy file to write - for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Add in the RJ_Broker acceptance type&lt;br /&gt;
  $c-&amp;gt;{sword}-&amp;gt;{supported_packages}-&amp;gt;{&amp;quot;http://opendepot.org/broker/1.0&amp;quot;} = &lt;br /&gt;
  {&lt;br /&gt;
    name =&amp;gt; &amp;quot;Repository Junction Broker&amp;quot;,&lt;br /&gt;
    plugin =&amp;gt; &amp;quot;Sword::Import::RJ_Broker&amp;quot;,&lt;br /&gt;
    qvalue =&amp;gt; &amp;quot;0.8&amp;quot;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is the string that's shown in the servicedocument&lt;br /&gt;
* The &amp;lt;code&amp;gt;plugin&amp;lt;/code&amp;gt; is the package used to handle the file deposited&lt;br /&gt;
* The &amp;lt;tt&amp;gt;qvalue&amp;lt;/tt&amp;gt; is what's known as the &amp;quot;Quality Value&amp;quot; - how closely the importer matches all the metadata wanted by the repository.&lt;br /&gt;
** The theory is that clients have a list of packages they can export as, and servers have a list of packages they understand - therefore a client can determine the best package for that transfer, based on relative QValues.&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10839</id>
		<title>SWORD</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10839"/>
		<updated>2013-10-11T15:16:38Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* servicedocument */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints 3 Plugins]]&lt;br /&gt;
This page is about SWORD which is a lightweight protocol for remotely depositing content into repositories.&lt;br /&gt;
&lt;br /&gt;
The SWORD project was funded by [http://www.jisc.ac.uk/ JISC] and more information can be found on the [http://swordapp.org official website].&lt;br /&gt;
&lt;br /&gt;
== SWORD made easy ==&lt;br /&gt;
&lt;br /&gt;
SWORD is basically an http put (or '''POST''') to a defined web URL, where the content of the posted request is the thing being deposited.&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses an http header field to define how the ''thing'' has been wrapped up ('''packaged''')&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses the content-type to deduce how to understand ''thing''&lt;br /&gt;
&lt;br /&gt;
By default, sword is ENABLED in all SWORD 3.2 &amp;amp; 3.3 EPrints servers, and access is available to all registered users.&lt;br /&gt;
&lt;br /&gt;
EPrints 3.2 uses SWORD 1.3&lt;br /&gt;
&lt;br /&gt;
EPrints 3.3 uses SWORD 2.0&lt;br /&gt;
&lt;br /&gt;
This document covers EPrints 3.2 &amp;amp; SWORD 1.3&lt;br /&gt;
For information on SWORD 2 see [[API:EPrints/Apache/CRUD]].&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
* '''mediation''' This is where one user can deposit ''on behalf of'' another user.&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Protocol implementation ==&lt;br /&gt;
&lt;br /&gt;
verbose&lt;br /&gt;
no-op&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default location for SWORD configuration is &lt;br /&gt;
&lt;br /&gt;
  archives/&amp;lt;your repo&amp;gt;/cfg/cfg.d/sword.pl&lt;br /&gt;
&lt;br /&gt;
This is where you enable and disable access to various ''collections'', and add/remove ''packages''&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The servicedocument is an XML listing of which &amp;quot;collections&amp;quot; are available, and what &amp;quot;packages&amp;quot; can be used with each one.&lt;br /&gt;
&lt;br /&gt;
* a &amp;quot;collection&amp;quot; in EPrints terms is &amp;lt;tt&amp;gt;inbox&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;review&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;archive&amp;lt;/tt&amp;gt; - which correspond to the users workspace, the administration review buffer, and visible in the live repository&lt;br /&gt;
* a &amp;quot;package&amp;quot; is an agreed method for wrapping up the data being sent over - as XML, as formatted text, in a zip file, etc...&lt;br /&gt;
&lt;br /&gt;
The default location for the servicedocument is &amp;lt;tt&amp;gt;/sword-app/servicedocument&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== example ===&lt;br /&gt;
Below is an example framework of the servicedocument&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;service xmlns=&amp;quot;http://www.w3.org/2007/app&amp;quot; xmlns:atom=&amp;quot;http://www.w3.org/2005/Atom&amp;quot; xmlns:sword=&amp;quot;http://purl.org/net/sword/&amp;quot;&lt;br /&gt;
   xmlns:dcterms=&amp;quot;http://purl.org/dc/terms/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;workspace&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;OpenDepot.org&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
    &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/inbox&amp;quot;&amp;gt;&lt;br /&gt;
    .... &lt;br /&gt;
    &amp;lt;/collection&amp;gt;&lt;br /&gt;
  &amp;lt;/workspace&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and in each collection is listed for package formats unsderstood:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;collection href=&amp;quot;http://opendepot.org/sword-app/deposit/buffer&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;atom:title&amp;gt;Repository Review&amp;lt;/atom:title&amp;gt;&lt;br /&gt;
    &amp;lt;accept&amp;gt;*/*&amp;lt;/accept&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.loc.gov/METS/&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;1.0&amp;quot;&amp;gt;http://eprints.org/ep2/data/2.0&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://www.imsglobal.org/xsd/imscp_v1p1&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:acceptPackaging q=&amp;quot;0.2&amp;quot;&amp;gt;http://purl.org/net/sword-types/METSDSpaceSIP&amp;lt;/sword:acceptPackaging&amp;gt;&lt;br /&gt;
    &amp;lt;sword:collectionPolicy/&amp;gt;&lt;br /&gt;
    &amp;lt;sword:treatment&amp;gt;&lt;br /&gt;
      Deposited items will undergo the review process. Upon approval, items will appear in the live repository.&lt;br /&gt;
    &amp;lt;/sword:treatment&amp;gt;&lt;br /&gt;
  &amp;lt;sword:mediation&amp;gt;true&amp;lt;/sword:mediation&amp;gt;&lt;br /&gt;
  &amp;lt;dcterms:abstract&amp;gt;This is the repository review.&amp;lt;/dcterms:abstract&amp;gt;&lt;br /&gt;
  &amp;lt;/collection&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Supported packages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
maybe how to write new importer plugins&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10838</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10838"/>
		<updated>2013-10-08T10:19:44Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Create the basic repository */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png]]&lt;br /&gt;
&lt;br /&gt;
We will build the web server on a private computer called ''services.example.com'', running on port ''1234''; and the public access will be ''eprints.example.com'', on port ''80''&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' In my install, all the &amp;lt;code&amp;gt;bin/&amp;lt;/code&amp;gt; files are installed with &amp;lt;code&amp;gt;/usr/bin/perl&amp;lt;/code&amp;gt;, not whatever's defined in the .configure statement - you may need to edit them!&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later) - so '''services.example.com'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later) - so '''1234'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf&lt;br /&gt;
&lt;br /&gt;
* Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section) - these are set on a per-repository basis&lt;br /&gt;
* Include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'eprints.example.com';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10837</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10837"/>
		<updated>2013-10-08T10:19:08Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Create the basic repository */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png]]&lt;br /&gt;
&lt;br /&gt;
We will build the web server on a private computer called ''services.example.com'', running on port ''1234''; and the public access will be ''eprints.example.com'', on port ''80''&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' In my install, all the &amp;lt;code&amp;gt;bin/&amp;lt;/code&amp;gt; files are installed with &amp;lt;code&amp;gt;/usr/bin/perl&amp;lt;/code&amp;gt;, not whatever's defined in the .configure statement.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later) - so '''services.example.com'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later) - so '''1234'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf&lt;br /&gt;
&lt;br /&gt;
* Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section) - these are set on a per-repository basis&lt;br /&gt;
* Include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'eprints.example.com';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10792</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10792"/>
		<updated>2013-06-03T11:02:43Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Configuring the repository: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png]]&lt;br /&gt;
&lt;br /&gt;
We will build the web server on a private computer called ''services.example.com'', running on port ''1234''; and the public access will be ''eprints.example.com'', on port ''80''&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later) - so '''services.example.com'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later) - so '''1234'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf&lt;br /&gt;
&lt;br /&gt;
* Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section) - these are set on a per-repository basis&lt;br /&gt;
* Include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'eprints.example.com';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10791</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10791"/>
		<updated>2013-06-03T10:53:02Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Configuring the repository: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png]]&lt;br /&gt;
&lt;br /&gt;
We will build the web server on a private computer called ''services.example.com'', running on port ''1234''; and the public access will be ''eprints.example.com'', on port ''80''&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later) - so '''services.example.com'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later) - so '''1234'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'eprints.example.com';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10790</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10790"/>
		<updated>2013-06-03T10:52:37Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Create the basic repository */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png]]&lt;br /&gt;
&lt;br /&gt;
We will build the web server on a private computer called ''services.example.com'', running on port ''1234''; and the public access will be ''eprints.example.com'', on port ''80''&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later) - so '''services.example.com'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later) - so '''1234'''&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'public.host.name.org';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10789</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10789"/>
		<updated>2013-06-03T10:51:16Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png]]&lt;br /&gt;
&lt;br /&gt;
We will build the web server on a private computer called ''services.example.com'', running on port ''1234''; and the public access will be ''eprints.example.com'', on port ''80''&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'public.host.name.org';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10788</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10788"/>
		<updated>2013-06-03T10:50:47Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png]]&lt;br /&gt;
&lt;br /&gt;
We will build the web server on a private computer called services.example.com, running on port 1234; and the public access will be eprints.example.com, on port 80&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'public.host.name.org';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10787</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10787"/>
		<updated>2013-06-03T10:48:50Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png]]&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'public.host.name.org';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10786</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10786"/>
		<updated>2013-06-03T10:48:24Z</updated>

		<summary type="html">&lt;p&gt;Kiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
[[Image:Webserver_proxy.png:Proxied system install]]&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'public.host.name.org';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=File:Webserver_proxy.png&amp;diff=10785</id>
		<title>File:Webserver proxy.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=File:Webserver_proxy.png&amp;diff=10785"/>
		<updated>2013-06-03T10:47:23Z</updated>

		<summary type="html">&lt;p&gt;Kiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10776</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10776"/>
		<updated>2013-05-29T07:52:49Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Preparation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. Cleverly, the Perl people have thought of this, and simply by running the &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command for the first time will configure the whole thing for you!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; cpan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When asked how you are installing Perl modules, the answer is &amp;lt;code&amp;gt;localLib&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'public.host.name.org';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10746</id>
		<title>SWORD</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=SWORD&amp;diff=10746"/>
		<updated>2013-03-12T16:35:01Z</updated>

		<summary type="html">&lt;p&gt;Kiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints 3 Plugins]]&lt;br /&gt;
This page is about SWORD which is a lightweight protocol for remotely depositing content into repositories.&lt;br /&gt;
&lt;br /&gt;
The SWORD project was funded by [http://www.jisc.ac.uk/ JISC] and more information can be found on the [http://swordapp.org official website].&lt;br /&gt;
&lt;br /&gt;
== SWORD made easy ==&lt;br /&gt;
&lt;br /&gt;
SWORD is basically an http put (or '''POST''') to a defined web URL, where the content of the posted request is the thing being deposited.&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses an http header field to define how the ''thing'' has been wrapped up ('''packaged''')&lt;br /&gt;
&lt;br /&gt;
SWORD 2.0 uses the content-type to deduce how to understand ''thing''&lt;br /&gt;
&lt;br /&gt;
By default, sword is ENABLED in all SWORD 3.2 &amp;amp; 3.3 EPrints servers, and access is available to all registered users.&lt;br /&gt;
&lt;br /&gt;
EPrints 3.2 uses SWORD 1.3&lt;br /&gt;
&lt;br /&gt;
EPrints 3.3 uses SWORD 2.0&lt;br /&gt;
&lt;br /&gt;
This document covers EPrints 3.2 &amp;amp; SWORD 1.3&lt;br /&gt;
For information on SWORD 2 see [[API:EPrints/Apache/CRUD]].&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
SWORD 1.3 uses some specific terms for specific meanings&lt;br /&gt;
* '''collection''' The specific URL within the server for the data to go into. For EPrints this generally means inbox, review, archive, deleted - however for DSpace, there is a Collection concept; and Fedora has a similar RDF tag for defining collective groupings.&lt;br /&gt;
* '''package''' The URI that identifies how a particular deposit has been wrapped up.&lt;br /&gt;
* '''mediation''' This is where one user can deposit ''on behalf of'' another user.&lt;br /&gt;
* '''servicedocument''' The document that the SWORD server can return to inform clients of what collections and what packages are understood by the service&lt;br /&gt;
&lt;br /&gt;
== Protocol implementation ==&lt;br /&gt;
&lt;br /&gt;
verbose&lt;br /&gt;
no-op&lt;br /&gt;
&lt;br /&gt;
== Configuring SWORD ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default location for SWORD configuration is &lt;br /&gt;
&lt;br /&gt;
  archives/&amp;lt;your repo&amp;gt;/cfg/cfg.d/sword.pl&lt;br /&gt;
&lt;br /&gt;
This is where you enable and disable access to various ''collections'', and add/remove ''packages''&lt;br /&gt;
&lt;br /&gt;
== servicedocument ==&lt;br /&gt;
&lt;br /&gt;
The default &lt;br /&gt;
== Supported packages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
maybe how to write new importer plugins&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=StyleGuide&amp;diff=10667</id>
		<title>StyleGuide</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=StyleGuide&amp;diff=10667"/>
		<updated>2012-11-23T10:14:27Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Automatically reformatting code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Contribute]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
EPrints has been under development for many years and has some fluff about the place. For new programmers this document is intended as a 'style guide' to at least keep the code and documentation consistent across new [[modules]].&lt;br /&gt;
&lt;br /&gt;
==Programming Style==&lt;br /&gt;
&lt;br /&gt;
===Naming===&lt;br /&gt;
&lt;br /&gt;
It helps if all things are written in a consistent style: when one looks at code, we recognise things by the format of the name:&lt;br /&gt;
&lt;br /&gt;
====Global Variables====&lt;br /&gt;
Global variables are variables that are ''in scope'' for the entire system, not restricted to specific user sessions. Examples of Global Variables are the AUTH_OK code returned by the Apache web server subsystem.&lt;br /&gt;
&lt;br /&gt;
EPrints follows the general Perl convention, and such variables (and '''CONSTANTS''') should be in CAPITAL LETTERS&lt;br /&gt;
&lt;br /&gt;
As a general rule code outside the core should not really be creating global variables, however there are situations&lt;br /&gt;
&lt;br /&gt;
             AUTH_OK = &amp;quot;1&amp;quot;;&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
====Local Variables====&lt;br /&gt;
Variables in code must always be pre-declared, and should be given the most appropriate level of restriction&lt;br /&gt;
&lt;br /&gt;
'''[http://perldoc.perl.org/functions/my.html my]''', '''[http://perldoc.perl.org/functions/our.html our]''' and '''[http://perldoc.perl.org/functions/local.html local]''' variables are all available to you, however we really ''really'' suggest you use '''my''' variables wherever possible.&lt;br /&gt;
&lt;br /&gt;
Local variables should be given names that reflect their content ($authenticated) rather than a short nmenonic ($au). Local variables should be underscore seperated ($current_password), not camelCased ($currentPassword)&lt;br /&gt;
&lt;br /&gt;
''The appropriate length of a name is inversely proportional to the size of its scope.'' --Mark-Jason Dominus&lt;br /&gt;
&lt;br /&gt;
''Choose mnemonic identifiers. If you can't remember what mnemonic means, you've got a problem.'' -- Larry Wall&lt;br /&gt;
&lt;br /&gt;
Preferred technique:&lt;br /&gt;
&lt;br /&gt;
  my $proxy_depositor;&lt;br /&gt;
  $proxy_depositor = get_proxy_depositor($session, $eprint);&lt;br /&gt;
&lt;br /&gt;
Acceptable technicque:&lt;br /&gt;
&lt;br /&gt;
  my $proxy_depositor = get_proxy_depositor($session, $eprint);&lt;br /&gt;
&lt;br /&gt;
====Subroutines====&lt;br /&gt;
Subroutines (aka ''functions'', aka ''methods'') should also be underscore seperated&lt;br /&gt;
&lt;br /&gt;
=====Public methods=====&lt;br /&gt;
These are the API calls that are used to interact with your code.&lt;br /&gt;
&lt;br /&gt;
Public methods must start with a lowe-case letter [a-z], and are required to have [http://perldoc.perl.org/perlpod.html POD] above them explaining the function and use of the method.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 =pod&lt;br /&gt;
&lt;br /&gt;
 =item * my_func( $var_1, %var_2 ):&lt;br /&gt;
&lt;br /&gt;
 Description of function, with examples&lt;br /&gt;
&lt;br /&gt;
=cut&lt;br /&gt;
&lt;br /&gt;
 sub my_func&lt;br /&gt;
 {&lt;br /&gt;
&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Private methods=====&lt;br /&gt;
Private functions are the subroutines in your modules that people should '''not''' be using.&lt;br /&gt;
Private functions should start with an underscore, and have simple perl comments above them, explaining the function of the subroutine.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 #########&lt;br /&gt;
 #&lt;br /&gt;
 # _my_subby( $var_1, %var_2 ):&lt;br /&gt;
 #&lt;br /&gt;
 # Description of function, with examples&lt;br /&gt;
 #&lt;br /&gt;
 sub _my_subby&lt;br /&gt;
 {&lt;br /&gt;
&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Modules====&lt;br /&gt;
Modules (aka ''packages'') are the file that contains the collection of methods &amp;amp; private funtions that makes your code do whatever it does.&lt;br /&gt;
&lt;br /&gt;
Modules are named in the perl style: Perl informally reserves lowercase module names for ''pragma'' modules like integer and strict. Other modules should begin with a capital letter and use mixed case&lt;br /&gt;
&lt;br /&gt;
     package EPrints::Plugin::Sword::Import::FiddleDeeDee&lt;br /&gt;
&lt;br /&gt;
See the [[modules]] page for full details.&lt;br /&gt;
&lt;br /&gt;
===General layout/presentation notes===&lt;br /&gt;
We lay out code mostly in the GNU style: curly braces are on the next line, aligned with the start of the thing that defines the block; closing braces align with the opening brace.&lt;br /&gt;
&lt;br /&gt;
When there is a literal list (variables being passed into a subroutine; an array being created; etc) and the sequence of items extends beyond 80 characters, wrap the line after a comma.&lt;br /&gt;
&lt;br /&gt;
   $thinggy = my_subroutine( $session, $short_variable,&lt;br /&gt;
                             $long_variable_name,&lt;br /&gt;
                             { 'key_1' =&amp;gt; $value_one,&lt;br /&gt;
                               'key_2' =&amp;gt; $value_two&lt;br /&gt;
                             }&lt;br /&gt;
                           );&lt;br /&gt;
&lt;br /&gt;
If the literal list is a more regular block of items, padding things to make it more grid-like is preferred:&lt;br /&gt;
&lt;br /&gt;
  @months_of_the_year = ( 'January', 'February', 'March',&lt;br /&gt;
                          'April',   'May',      'June',&lt;br /&gt;
                          'July',    'August',   'September',&lt;br /&gt;
                          'October', 'November', 'December'&lt;br /&gt;
                        );&lt;br /&gt;
&lt;br /&gt;
===Subroutines===&lt;br /&gt;
This applies to ''all'' subroutines - public or private.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
             sub get_value&lt;br /&gt;
             {&lt;br /&gt;
                 my( $self, $arg1, $arg2 ) = @_;&lt;br /&gt;
&lt;br /&gt;
                 return $r;&lt;br /&gt;
             }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When writing &amp;quot;if/else&amp;quot; sets, have the short option at the top, even if this means doing an &amp;quot;if not&amp;quot; or an &amp;quot;unless&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   if (!$authenticated)&lt;br /&gt;
   {&lt;br /&gt;
       log_error(&amp;quot;Not authenticated&amp;quot;);&lt;br /&gt;
       return&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
       # long sequence of code   &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Where possible, use &amp;quot;return&amp;quot; rather than an &amp;quot;if&amp;quot; block.&lt;br /&gt;
&lt;br /&gt;
AVOID:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
             sub get_value&lt;br /&gt;
             {&lt;br /&gt;
                 my( $self, $arg1 ) = @_;&lt;br /&gt;
&lt;br /&gt;
                 my $r;&lt;br /&gt;
                 if( $arg1 )&lt;br /&gt;
                 {&lt;br /&gt;
                     $r = $arg1 * 2;&lt;br /&gt;
                 }&lt;br /&gt;
                 else&lt;br /&gt;
                 {&lt;br /&gt;
                     log( &amp;quot;some error&amp;quot; );&lt;br /&gt;
                 }&lt;br /&gt;
                     &lt;br /&gt;
                 return $r;&lt;br /&gt;
             }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prefer this style instead, treating the problem like a basic exception to the normal running of the function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
             sub get_value&lt;br /&gt;
             {&lt;br /&gt;
                 my( $self, $arg1 ) = @_;&lt;br /&gt;
&lt;br /&gt;
                 if( !defined $arg1 )&lt;br /&gt;
                 {&lt;br /&gt;
                     log( &amp;quot;some error&amp;quot; );&lt;br /&gt;
                     return;&lt;br /&gt;
                 }&lt;br /&gt;
     &lt;br /&gt;
                 return $arg1 * 2;&lt;br /&gt;
             }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Conditionals===&lt;br /&gt;
Conditionals should always preceed the code block they control.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
             if( ref($a) eq &amp;quot;ARRAY&amp;quot; )&lt;br /&gt;
             {&lt;br /&gt;
                 print &amp;quot;Dang&amp;quot;;&lt;br /&gt;
                 return 0;&lt;br /&gt;
             }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the code-block is a single line, and the conditional plus code-block can fit on a single line, then the perl short-form is acceptable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
             return 0 if( ref($a) eq &amp;quot;ARRAY&amp;quot; );&lt;br /&gt;
             $a = 23 if( !defined $a );&lt;br /&gt;
             $dom-&amp;gt;appendChild($foo_bar) if (!$bish_bash)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
However this is NEVER OK:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
             if( !defined $a ) $a = 23;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Loops===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
             foreach my $field ( @fields )&lt;br /&gt;
             {&lt;br /&gt;
                     push @foo, $field-&amp;gt;get_name();&lt;br /&gt;
             }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
OR, when nested:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
             FIELD: foreach my $field ( @fields )&lt;br /&gt;
             { &lt;br /&gt;
                     VALUE: foreach my $value ( @{$field-&amp;gt;{ &amp;quot;lsd&amp;quot; }} )&lt;br /&gt;
                     {&lt;br /&gt;
                             next VALUE if !defined $value; &lt;br /&gt;
                             $values{ $value } = 1;&lt;br /&gt;
                     }&lt;br /&gt;
             }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Avoid $_ where possible, it is just confusing to everyone else (and has a tendency to be written over by Lazy Programmers)&lt;br /&gt;
&lt;br /&gt;
Try and use &amp;quot;next&amp;quot; rather than if when inside loops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Automatically reformatting code==&lt;br /&gt;
There is a wonderful utility called ''perltidy'' ([http://perltidy.sourceforge.net/ website])&lt;br /&gt;
&lt;br /&gt;
This reformats perl for you (and does a syntax check at the same time... lovely.&lt;br /&gt;
&lt;br /&gt;
Use:&lt;br /&gt;
&lt;br /&gt;
  perltidy -gnu -csc -b JSON.pm&lt;br /&gt;
&lt;br /&gt;
  -gnu reformats into the general 'gnu' style (as opposed to the &amp;quot;Larry Wall/Perl&amp;quot; style)&lt;br /&gt;
  -csc adds comments to the end of longish loops&lt;br /&gt;
  -b edits the file in place (so you may want to leave that off initially)&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10666</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10666"/>
		<updated>2012-11-16T12:05:46Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Configuring the repository: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. We need a directory to install this tree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; mkdir ~/perl5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need to be able to install some Perl packages from CPAN, so we need a configuration for that:&lt;br /&gt;
&lt;br /&gt;
To set up cpan install as a non-root user, you need to set up your own &amp;lt;code&amp;gt;~/.cpan/CPAN/MyConfig.pm&amp;lt;/code&amp;gt; file. Copy one from another user, or find the system-wide one.&lt;br /&gt;
You need to edit the values of a few keys in &amp;lt;code&amp;gt;$CPAN::Config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;'build_dir'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'cpan_home'&amp;lt;/code&amp;gt;, &amp;amp;amp; &amp;lt;code&amp;gt;'keep_source_where'&amp;lt;/code&amp;gt; all need to be set to the full path for the users .cpan directory (eg: &amp;lt;code&amp;gt;'build_dir' =&amp;amp;gt; q[/home/MyUser/.cpan/build],&amp;lt;/code&amp;gt; )&lt;br /&gt;
* &amp;lt;code&amp;gt;'makepl_arg'&amp;lt;/code&amp;gt; needs to be set to &amp;lt;code&amp;gt;PREFIX=/home/MyUser/perl5&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;IMPORTANT&amp;lt;/span&amp;gt;''' Be sure to remove the &amp;lt;code&amp;gt;UNINST=1&amp;lt;/code&amp;gt; option on &amp;lt;code&amp;gt;make_install_arg&amp;lt;/code&amp;gt; otherwise CPAN will attempt to remove “shadowing” versions of the module installed for the system-wide perl installation&lt;br /&gt;
&lt;br /&gt;
You will need to set up a &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; environment variable for the shell (to run the various ePrints scripts). The easy way to work out what you need here is to see what the default library path is, and modify it for your user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; perl -V&lt;br /&gt;
Summary of my perl5 (revision....&lt;br /&gt;
[snip]&lt;br /&gt;
  @INC:&lt;br /&gt;
    /some/path/lib/perl5/5.8.0/sun4-solaris&lt;br /&gt;
    /some/path/lib/perl5/5.8.0&lt;br /&gt;
    /some/path/lib/perl5/site_perl/5.8.0/sun4-solaris&lt;br /&gt;
    /some/path/lib/perl5/site_perl/5.8.0&lt;br /&gt;
    /some/path/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(This was developed on a Sun box, you may have something different to &amp;lt;code&amp;gt;sun4-solaris&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
We replace &amp;quot;/some/path&amp;quot; with the path to our new PREFIX (as defined above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; export PERL5LIB=/home/MyUser/perl5/lib/perl5/site_perl/5.8.0/sun4-solaris/: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/5.8.0/sun4-solaris: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/5.8.0: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl/5.8.0/MyUser: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl/5.8.0: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add this to the users login/profile scripts (eg .bashrc)&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
EPrints has a global Apache configuration file, and then separate config files for each &amp;amp;lt;ARCHIVEID&amp;amp;gt; archive running under the web server&lt;br /&gt;
&lt;br /&gt;
To be sure of the correct config files for your particular install (we are discovering that they seem to move around depending on version), do the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 find ./ -name *.conf -print&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'public.host.name.org';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10665</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10665"/>
		<updated>2012-11-16T11:01:25Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* ePrints */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. We need a directory to install this tree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; mkdir ~/perl5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need to be able to install some Perl packages from CPAN, so we need a configuration for that:&lt;br /&gt;
&lt;br /&gt;
To set up cpan install as a non-root user, you need to set up your own &amp;lt;code&amp;gt;~/.cpan/CPAN/MyConfig.pm&amp;lt;/code&amp;gt; file. Copy one from another user, or find the system-wide one.&lt;br /&gt;
You need to edit the values of a few keys in &amp;lt;code&amp;gt;$CPAN::Config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;'build_dir'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'cpan_home'&amp;lt;/code&amp;gt;, &amp;amp;amp; &amp;lt;code&amp;gt;'keep_source_where'&amp;lt;/code&amp;gt; all need to be set to the full path for the users .cpan directory (eg: &amp;lt;code&amp;gt;'build_dir' =&amp;amp;gt; q[/home/MyUser/.cpan/build],&amp;lt;/code&amp;gt; )&lt;br /&gt;
* &amp;lt;code&amp;gt;'makepl_arg'&amp;lt;/code&amp;gt; needs to be set to &amp;lt;code&amp;gt;PREFIX=/home/MyUser/perl5&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;IMPORTANT&amp;lt;/span&amp;gt;''' Be sure to remove the &amp;lt;code&amp;gt;UNINST=1&amp;lt;/code&amp;gt; option on &amp;lt;code&amp;gt;make_install_arg&amp;lt;/code&amp;gt; otherwise CPAN will attempt to remove “shadowing” versions of the module installed for the system-wide perl installation&lt;br /&gt;
&lt;br /&gt;
You will need to set up a &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; environment variable for the shell (to run the various ePrints scripts). The easy way to work out what you need here is to see what the default library path is, and modify it for your user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; perl -V&lt;br /&gt;
Summary of my perl5 (revision....&lt;br /&gt;
[snip]&lt;br /&gt;
  @INC:&lt;br /&gt;
    /some/path/lib/perl5/5.8.0/sun4-solaris&lt;br /&gt;
    /some/path/lib/perl5/5.8.0&lt;br /&gt;
    /some/path/lib/perl5/site_perl/5.8.0/sun4-solaris&lt;br /&gt;
    /some/path/lib/perl5/site_perl/5.8.0&lt;br /&gt;
    /some/path/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(This was developed on a Sun box, you may have something different to &amp;lt;code&amp;gt;sun4-solaris&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
We replace &amp;quot;/some/path&amp;quot; with the path to our new PREFIX (as defined above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; export PERL5LIB=/home/MyUser/perl5/lib/perl5/site_perl/5.8.0/sun4-solaris/: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/5.8.0/sun4-solaris: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/5.8.0: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl/5.8.0/MyUser: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl/5.8.0: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add this to the users login/profile scripts (eg .bashrc)&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and add &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;xxxx&amp;quot;; &amp;lt;/pre&amp;gt; where '''xxx''' is the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'public.host.name.org';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10657</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10657"/>
		<updated>2012-11-15T14:15:36Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Create the basic repository */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. We need a directory to install this tree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; mkdir ~/perl5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need to be able to install some Perl packages from CPAN, so we need a configuration for that:&lt;br /&gt;
&lt;br /&gt;
To set up cpan install as a non-root user, you need to set up your own &amp;lt;code&amp;gt;~/.cpan/CPAN/MyConfig.pm&amp;lt;/code&amp;gt; file. Copy one from another user, or find the system-wide one.&lt;br /&gt;
You need to edit the values of a few keys in &amp;lt;code&amp;gt;$CPAN::Config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;'build_dir'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'cpan_home'&amp;lt;/code&amp;gt;, &amp;amp;amp; &amp;lt;code&amp;gt;'keep_source_where'&amp;lt;/code&amp;gt; all need to be set to the full path for the users .cpan directory (eg: &amp;lt;code&amp;gt;'build_dir' =&amp;amp;gt; q[/home/MyUser/.cpan/build],&amp;lt;/code&amp;gt; )&lt;br /&gt;
* &amp;lt;code&amp;gt;'makepl_arg'&amp;lt;/code&amp;gt; needs to be set to &amp;lt;code&amp;gt;PREFIX=/home/MyUser/perl5&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;IMPORTANT&amp;lt;/span&amp;gt;''' Be sure to remove the &amp;lt;code&amp;gt;UNINST=1&amp;lt;/code&amp;gt; option on &amp;lt;code&amp;gt;make_install_arg&amp;lt;/code&amp;gt; otherwise CPAN will attempt to remove “shadowing” versions of the module installed for the system-wide perl installation&lt;br /&gt;
&lt;br /&gt;
You will need to set up a &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; environment variable for the shell (to run the various ePrints scripts). The easy way to work out what you need here is to see what the default library path is, and modify it for your user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; perl -V&lt;br /&gt;
Summary of my perl5 (revision....&lt;br /&gt;
[snip]&lt;br /&gt;
  @INC:&lt;br /&gt;
    /some/path/lib/perl5/5.8.0/sun4-solaris&lt;br /&gt;
    /some/path/lib/perl5/5.8.0&lt;br /&gt;
    /some/path/lib/perl5/site_perl/5.8.0/sun4-solaris&lt;br /&gt;
    /some/path/lib/perl5/site_perl/5.8.0&lt;br /&gt;
    /some/path/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(This was developed on a Sun box, you may have something different to &amp;lt;code&amp;gt;sun4-solaris&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
We replace &amp;quot;/some/path&amp;quot; with the path to our new PREFIX (as defined above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; export PERL5LIB=/home/MyUser/perl5/lib/perl5/site_perl/5.8.0/sun4-solaris/: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/5.8.0/sun4-solaris: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/5.8.0: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl/5.8.0/MyUser: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl/5.8.0: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add this to the users login/profile scripts (eg .bashrc)&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and set &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} = &amp;quot;mysql&amp;quot;; &amp;lt;/pre&amp;gt; to the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'public.host.name.org';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10656</id>
		<title>Non-root proxy</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Non-root_proxy&amp;diff=10656"/>
		<updated>2012-11-15T14:14:30Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Create the basic repository */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation]]&lt;br /&gt;
===Task===&lt;br /&gt;
To build Apache 2 &amp;amp;amp; mod_perl 2 for ePrints 3, installed as a standard user, with no superuser-like access to core services (including Perl and mySQL).  The ePrints server will run as a normal user, and be accessed through a central proxy&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
As we are installing software as a normal user (I'll use MyUser in this example), we are not adding any additional Perl modules centrally, but into a local tree. We need a directory to install this tree:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; mkdir ~/perl5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need to be able to install some Perl packages from CPAN, so we need a configuration for that:&lt;br /&gt;
&lt;br /&gt;
To set up cpan install as a non-root user, you need to set up your own &amp;lt;code&amp;gt;~/.cpan/CPAN/MyConfig.pm&amp;lt;/code&amp;gt; file. Copy one from another user, or find the system-wide one.&lt;br /&gt;
You need to edit the values of a few keys in &amp;lt;code&amp;gt;$CPAN::Config&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;'build_dir'&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;'cpan_home'&amp;lt;/code&amp;gt;, &amp;amp;amp; &amp;lt;code&amp;gt;'keep_source_where'&amp;lt;/code&amp;gt; all need to be set to the full path for the users .cpan directory (eg: &amp;lt;code&amp;gt;'build_dir' =&amp;amp;gt; q[/home/MyUser/.cpan/build],&amp;lt;/code&amp;gt; )&lt;br /&gt;
* &amp;lt;code&amp;gt;'makepl_arg'&amp;lt;/code&amp;gt; needs to be set to &amp;lt;code&amp;gt;PREFIX=/home/MyUser/perl5&amp;lt;/code&amp;gt;&lt;br /&gt;
* '''&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;IMPORTANT&amp;lt;/span&amp;gt;''' Be sure to remove the &amp;lt;code&amp;gt;UNINST=1&amp;lt;/code&amp;gt; option on &amp;lt;code&amp;gt;make_install_arg&amp;lt;/code&amp;gt; otherwise CPAN will attempt to remove “shadowing” versions of the module installed for the system-wide perl installation&lt;br /&gt;
&lt;br /&gt;
You will need to set up a &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; environment variable for the shell (to run the various ePrints scripts). The easy way to work out what you need here is to see what the default library path is, and modify it for your user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; perl -V&lt;br /&gt;
Summary of my perl5 (revision....&lt;br /&gt;
[snip]&lt;br /&gt;
  @INC:&lt;br /&gt;
    /some/path/lib/perl5/5.8.0/sun4-solaris&lt;br /&gt;
    /some/path/lib/perl5/5.8.0&lt;br /&gt;
    /some/path/lib/perl5/site_perl/5.8.0/sun4-solaris&lt;br /&gt;
    /some/path/lib/perl5/site_perl/5.8.0&lt;br /&gt;
    /some/path/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(This was developed on a Sun box, you may have something different to &amp;lt;code&amp;gt;sun4-solaris&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
We replace &amp;quot;/some/path&amp;quot; with the path to our new PREFIX (as defined above):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;amp;gt; export PERL5LIB=/home/MyUser/perl5/lib/perl5/site_perl/5.8.0/sun4-solaris/: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/5.8.0/sun4-solaris: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/5.8.0: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl/5.8.0/MyUser: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl/5.8.0: \&lt;br /&gt;
            /home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add this to the users login/profile scripts (eg .bashrc)&lt;br /&gt;
&lt;br /&gt;
===Now we can start installing software.===&lt;br /&gt;
====Apache====&lt;br /&gt;
Install a base Apache (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf httpd-2.2.x.tar&lt;br /&gt;
%&amp;gt; cd httpd_2.2.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make distclean&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install an initial Apache server:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/www --disable-userdir --disable-status&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit http.conf (essentially, the port the server is listening on) and start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mod-Perl====&lt;br /&gt;
Stop web server and install the Mod-Perl extensions (previously downloaded into ~/distributions):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf mod_perl-2.0-current.tar&lt;br /&gt;
%&amp;gt; cd mod_perl-2.0.x&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are returning to an existing source-tree, rather than a brand new untar'd bundle, clear any previous setup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; make clean &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now configure and install mod-perl into the Apache tree, and (re)install Apache. In this example, I am specifying a version of Perl to use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl Makefile.PL PREFIX=&amp;quot;/home/MyUser/perl5&amp;quot; MP_USE_DSO=1 \&lt;br /&gt;
   MP_APXS=&amp;quot;/home/MyUser/www/bin/apxs&amp;quot; \&lt;br /&gt;
   MP_AP_CONFIGURE=&amp;quot;--prefix=/home/MyUser/www --disable-userdir \&lt;br /&gt;
   --disable-status --enable-module=mod-perl&amp;quot;&lt;br /&gt;
%&amp;gt; make&lt;br /&gt;
%&amp;gt; make install&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: Notice that there is a PREFIX defined, which matches the prefix in the CPAN configuration; that we are stating we want mod-perl as a DSO; the full path to the previously installed Apache &amp;quot;apxs&amp;quot; command; and that the configure parameters to be passed to the apache rebuild include enabling mod-perl&lt;br /&gt;
&lt;br /&gt;
=====Editing the new apache config file=====&lt;br /&gt;
We need to enable the mod-perl module, which I do using one of the Includes:&lt;br /&gt;
*  In ~/www/conf/httpd.conf, add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Mod-Perl&lt;br /&gt;
Include conf/extra/httpd-perl.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create ~/www/conf/extra/httpd-perl.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Load the Mod_perl DSO.&lt;br /&gt;
#&lt;br /&gt;
LoadModule perl_module modules/mod_perl.so&lt;br /&gt;
PerlSwitches -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris/ \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y/sun4-solaris \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl/5.x.y \&lt;br /&gt;
             -I/home/MyUser/perl5/lib/perl5/site_perl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NOTE: the &amp;quot;PerlSwitches&amp;quot; line tells the Apache server where to look for extra libraries, and matches the PERL5LIB environment variable set earlier.&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.x (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.x (Unix) mod_perl/2.0.x Perl/v5.x.y configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stop the web server again.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ePrints===&lt;br /&gt;
Before you can install ePrints, you need to check the Package requirements.&lt;br /&gt;
CGI.pm builds against the installed Mod-Perl modules, so may well be wrong. You may need to install your own version.&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; /path/to/specific/perl -MCPAN -e shell&lt;br /&gt;
[snip]&lt;br /&gt;
cpan&amp;gt; install CGI&lt;br /&gt;
[...]&lt;br /&gt;
cpan&amp;gt; quit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can install the ePrints software (previously downloaded into ~/distributions):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd ~/distributions/&lt;br /&gt;
%&amp;gt; tar xvf eprints-3.zzz.tar&lt;br /&gt;
%&amp;gt; cd eprints-3.zzz./&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no option to clean a previously configured eprints tree, so keep going..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./configure --prefix=/home/MyUser/ePrints --with-perl=/path/to/specific/perl --with-user=MyUser \&lt;br /&gt;
    --with-group=MyUserGroup -with-toolpath=/path/to/tools --disable-diskfree \&lt;br /&gt;
    --with-smtp-server=your.mail.server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the same version of perl is being defined again, and the &amp;lt;code&amp;gt;/path/to/tools&amp;lt;/code&amp;gt; is a directory to find various external tools (&amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;wget&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;(g)unzip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pdftotext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lynx&amp;lt;/code&amp;gt;, etc)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;... and install:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; ./install.pl&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we do not have root access to the MySQL database, you will need to get the database administrator to add a user to provide access the MySQL database. Note: Assuming your user is not given &amp;lt;code&amp;gt;GRANT ALL&amp;lt;/code&amp;gt; (its a big security risk) you will need &amp;lt;code&amp;gt;CREATE TEMPORARY TABLES&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;CREATE&amp;lt;/code&amp;gt; privilages.&lt;br /&gt;
&lt;br /&gt;
====Create the basic repository====&lt;br /&gt;
&lt;br /&gt;
The trick here is to install a basic eprint repository to match the web server (installed above), and then alter the core configuration to reflect the proxy settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also know that the service is going to run as a local user, so the file and directory permissions need to be altered&lt;br /&gt;
&lt;br /&gt;
These are all defined in the file &amp;lt;code&amp;gt;perl_lib/EPrints/SystemSettings.pm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$EPrints::SystemSettings::conf = {&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'file_perms' =&amp;gt; 0640,&lt;br /&gt;
                                       // snip //&lt;br /&gt;
                                    'dir_perms' =&amp;gt; 0775&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In EPrints 3, all the configuration is done using the &amp;lt;code&amp;gt;bin/epadmin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Initial configuration&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' EPrints assumes a MySql backend, and the configuration routines assume it. This means that you need to have the mysql libraries available to the perl routines during this process. You may setup a Postgres, Oracle, or &amp;quot;Cloud&amp;quot; storage system once the basic configuration is in place, but you need mysql to kick-start the process.&lt;br /&gt;
&lt;br /&gt;
The command to create the basic framework for a repository is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bin/epadmin create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure vital settings? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Hostname?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the public address (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Webserver Port [80] ?&amp;lt;/code&amp;gt; is the actual address of the web server created above, not the port for the web server (we fix that later)&lt;br /&gt;
** &amp;lt;code&amp;gt;Archive Name [Test Repository] ?&amp;lt;/code&amp;gt; is the name that the EPrints.org system will use when it dynamically supplies the archive name (using the &amp;amp;lt;epc:pin /&amp;amp;gt; coding)&lt;br /&gt;
&lt;br /&gt;
* When asked &amp;lt;code&amp;gt;Configure database? [yes] ?&amp;lt;/code&amp;gt;, say &amp;quot;Yes&amp;quot; and fill in the details&lt;br /&gt;
** &amp;lt;code&amp;gt;Database Name&amp;lt;/code&amp;gt; is the name of the database created for you by the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Host&amp;lt;/code&amp;gt; is the hostname for the server&lt;br /&gt;
** &amp;lt;code&amp;gt;MySQL Port&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;MySQL Socket&amp;lt;/code&amp;gt; can probably be left blank, but check with the database admin people&lt;br /&gt;
** &amp;lt;code&amp;gt;Database User&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;Database Password&amp;lt;/code&amp;gt; is as per agreed with the database admin people&lt;br /&gt;
* &amp;lt;code&amp;gt;Create database &amp;quot;Deposit&amp;quot;&amp;lt;/code&amp;gt; &amp;lt;b&amp;gt;NO&amp;lt;/b&amp;gt; - you can't, as we don't have that level of access to the database.&lt;br /&gt;
&lt;br /&gt;
Now we need to do the rest of the building-work manually:&lt;br /&gt;
&lt;br /&gt;
When using a database that's '''not''' mysql, then you need to tell EPrints what driver to use.&lt;br /&gt;
* Edit &amp;lt;pre&amp;gt; archives/&amp;lt;ARCHIVEID&amp;gt;/cfg/cfg.d/database.pl &amp;lt;/pre&amp;gt; and set &amp;lt;pre&amp;gt; $c-&amp;gt;{dbdriver} &amp;lt;/pre&amp;gt; to the appropriate Perl DBD package (eg '''Pg''' for postgreSQL)&lt;br /&gt;
&lt;br /&gt;
* Create the database tables: &amp;lt;pre&amp;gt; bin/epadmin create_tables &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create users (I suggest an admin user and a normal user): &amp;lt;pre&amp;gt; bin/epadmin create_user &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Build the subject tables: &amp;lt;pre&amp;gt; bin/import_subjects &amp;lt;ARCHIVEID&amp;gt; &amp;lt;path/to/subject/file&amp;gt;&amp;lt;/pre&amp;gt; Either use &amp;lt;code&amp;gt;lib/defaultcfg/subjects&amp;lt;/code&amp;gt; for the shipped '''Library Of Congress''' tree, or download a subject tree from [http://files.eprints.org files.eprints.org]&lt;br /&gt;
* Create the static web pages for a basic web site: &amp;lt;pre&amp;gt; bin/generate_static &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; &lt;br /&gt;
* Create pages of abstracts: &amp;lt;pre&amp;gt; bin/generate_abstracts &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt; (should do nothing, as there are no abstracts in the system)&lt;br /&gt;
* Create the browse pages: &amp;lt;pre&amp;gt; bin/generate_views &amp;lt;ARCHIVEID&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the repository:====&lt;br /&gt;
&lt;br /&gt;
Generate the apache configuration files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; cd /home/MyUser/ePrints&lt;br /&gt;
 bin/generate_apacheconf &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit httpd.conf to include the generated apache.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# EPrints&lt;br /&gt;
Include /home/MyUser/ePrints/cfg/apache.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remove the document root and cgi-bin stuff from the httpd.conf file (the name and the &amp;lt;directory&amp;gt; section)&lt;br /&gt;
&lt;br /&gt;
Add access permissions to the &amp;lt;code&amp;gt;&amp;amp;lt;Directory &amp;quot;/home/MyUser/ePrints/cgi&amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/auto-apache.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
EPrints produces absolute URLs for everything (&amp;lt;code&amp;gt;http://web.host.name/&amp;lt;/code&amp;gt;), so we need to ensure that the repository uses the correct address. Edit &amp;lt;code&amp;gt;archives/&amp;lt;i&amp;gt;ARCHIVEID&amp;lt;/i&amp;gt;/cfg/cfg.d/10_core.pl&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{host} = 'public.host.name.org';&lt;br /&gt;
$c-&amp;gt;{port} = '80';&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Fix a bug-ette====&lt;br /&gt;
There is a problem that has been found on a number of systems where the system goes into a loop of reporting&lt;br /&gt;
&amp;lt;pre&amp;gt; [warn] (128)Network is unreachable: connect to listener on [::]:&amp;lt;PORTNO&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is to alter the &amp;quot;Listen&amp;quot; directive to include an IP number. Either use the IP number for the host, or cheat:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Listen: 0.0.0.0:&amp;lt;PORTNO&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start web server.  Check the error log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%&amp;gt; cat ~/www/logs/error_log&lt;br /&gt;
[...] Apache/2.2.0 (Unix) Configured -- resuming normal operations&lt;br /&gt;
[...] caught SIGTERM, shutting down&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
[...] [notice] caught SIGTERM, shutting down&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
EPrints archives loaded: &amp;lt;ARCHIVEID&amp;gt;&lt;br /&gt;
[...] Apache/2.2.0 (Unix) mod_perl/2.0.2 Perl/v5.8.0 configured -- resuming normal operations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GLORY IN YOUR NEW EPRINTS SYSTEM!!!!===&lt;br /&gt;
&lt;br /&gt;
To modify the general layout of the page, edit &amp;lt;code&amp;gt;ePrints/archives/&amp;amp;lt;ARCHIVEID&amp;amp;gt;/cfg/template-en.xml&amp;lt;/code&amp;gt; and then re-run &amp;lt;code&amp;gt;.../bin/generate_static &amp;amp;lt;ARCHIVEID&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10609</id>
		<title>Bazaar Edinburgh 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10609"/>
		<updated>2012-08-02T11:16:44Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Day 2 - Thursday 2nd August 2012 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints_Bazaar]]&lt;br /&gt;
&lt;br /&gt;
This page offers an agenda for the 3 day Bazaar development event in Edinburgh 1-3 August 2012.&lt;br /&gt;
&lt;br /&gt;
Location: EH9 1PR&lt;br /&gt;
&lt;br /&gt;
Over the course of the days the aim is to test, document and better represent our selves in the bazaar store where things are already a little messy (slap wrists people). Through testing of packages we need to improve descriptions, icons and compliment the packages with screen shots to help our users. &lt;br /&gt;
&lt;br /&gt;
=Day 1 - Wednesday 1st August 2012=&lt;br /&gt;
&lt;br /&gt;
* Bazaar &lt;br /&gt;
** Package Improvement, Config, Dependancies, Documentation, Screenshot&lt;br /&gt;
*** Amazon S3&lt;br /&gt;
*** Green Spring&lt;br /&gt;
*** Batch Edit&lt;br /&gt;
*** Icon Builder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
** Dependencies Ideas&lt;br /&gt;
** Bazaar Store Improvements - Seal of Approval, Screenshots, Tags, Display of Dependancies Field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Core&lt;br /&gt;
** Loosing Data on Disable/Uninstall&lt;br /&gt;
&lt;br /&gt;
===Green Spring===&lt;br /&gt;
* Capture screenshot&lt;br /&gt;
&lt;br /&gt;
===Batch Edit===&lt;br /&gt;
* Installer fails to detect a lack of external dependencies: Spreadsheet::ParseExcel, Spreadsheet::WriteExcel&lt;br /&gt;
* Install is a silent fail&lt;br /&gt;
* Uninstall fails with a misleading error (&amp;quot;Repository configuration not reloaded. Errors in configuration files&amp;quot; rather than not actually active)&lt;br /&gt;
** The fix is to edit the config, and save. This allows you to uninstall.&lt;br /&gt;
* The export function appears to work properly, however, I cannot even find the import option.&lt;br /&gt;
* In all honesty, I don't think this plugin can be described as &amp;quot;functional&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===EXIF Import===&lt;br /&gt;
* Captured screenshots&lt;br /&gt;
* Plugin description could be a bit less brief&lt;br /&gt;
* Plugin does not actually work&lt;br /&gt;
* There is a dependancy on IMAGE::Exif&lt;br /&gt;
* once that is installed the plugin still fails&lt;br /&gt;
* Unhandled warning in Import::EXIF: File not found: *Fh::fh00001bear.jpg &lt;br /&gt;
* Warning	Import failed: 1 item(s) imported before an error caused the import to abort.&lt;br /&gt;
&lt;br /&gt;
===Icon Builder===&lt;br /&gt;
* Installs without issue&lt;br /&gt;
* must navigate to cgi/icon_builder (this should probably be a screen plugin with a link in key_tools or the admin panels)&lt;br /&gt;
** FIXED - Added to System Tools Panel&lt;br /&gt;
* you can upload a jpg and modify the baground colour.&lt;br /&gt;
* when you hit export the file it returns is not a vaild jpeg&lt;br /&gt;
** Cos it's a PNG&lt;br /&gt;
&lt;br /&gt;
===AmazonS3===&lt;br /&gt;
* Installed &lt;br /&gt;
* updated package to do dependancy checking and output appropriate error messages&lt;br /&gt;
* outputs help to configure after installation &lt;br /&gt;
* created an example storeage policy&lt;br /&gt;
* tested fully&lt;br /&gt;
* dave t and dave m took screen shots&lt;br /&gt;
&lt;br /&gt;
===OREExport===&lt;br /&gt;
* Installed plugin&lt;br /&gt;
* Took screen shots&lt;br /&gt;
* Export works &lt;br /&gt;
* Import is broken and needs looking into, this is more a problem with the upstream code than bazaar package.&lt;br /&gt;
&lt;br /&gt;
===SNEEP===&lt;br /&gt;
* Installed &lt;br /&gt;
* works&lt;br /&gt;
* Screenshots&lt;br /&gt;
&lt;br /&gt;
===Schedule===&lt;br /&gt;
* 11:30 - A Simple Start, take the easy packages and improve and screen shot them.&lt;br /&gt;
* 12:45 - Lunch&lt;br /&gt;
* 14:00 - Complex Bazaar Package Testing&lt;br /&gt;
The idea here is to test the more complex packages (those that require dependencies outside of those needed by eprints) and work out how to best support our &amp;quot;one click&amp;quot; users in installing these packages. Additionally we should looks for packages that need config and make sure they have a &amp;quot;config&amp;quot; link!. These packages include:&lt;br /&gt;
** Coversheets&lt;br /&gt;
** Preservation Toolkit&lt;br /&gt;
** Tweepository&lt;br /&gt;
** Open Office Toolkit&lt;br /&gt;
&lt;br /&gt;
=Day 2 - Thursday 2nd August 2012=&lt;br /&gt;
&lt;br /&gt;
* 09:30 - Bazaar Store Upgrades &amp;amp; Package Testing&lt;br /&gt;
Put all the stuff from yesterday in the store. &lt;br /&gt;
** Screenshots &lt;br /&gt;
** Dependencies&lt;br /&gt;
** Descriptions &lt;br /&gt;
** Icons&lt;br /&gt;
&lt;br /&gt;
===collections===&lt;br /&gt;
&lt;br /&gt;
* 11:00 - Languages Packs &lt;br /&gt;
Take the language packs from files and put them in the store. &lt;br /&gt;
* 12:30 - Lunch&lt;br /&gt;
* 13:30 - Package Fest&lt;br /&gt;
&lt;br /&gt;
=Day 3 - Friday 3rd August 2012=&lt;br /&gt;
* Package Fest&lt;br /&gt;
&lt;br /&gt;
[[File:DSC_0020.JPG|thumb]]&lt;br /&gt;
&lt;br /&gt;
=Attendees=&lt;br /&gt;
&lt;br /&gt;
* Les Carr - University of Southampton&lt;br /&gt;
* David Tarrant - University of Southampton&lt;br /&gt;
* Tim Brody - University of Southampton&lt;br /&gt;
* Patrick McSweeney - University of Southampton&lt;br /&gt;
* Matthew Taylor - University of Southampton&lt;br /&gt;
* Adam Field - University of Southampton&lt;br /&gt;
&lt;br /&gt;
Please add your name ...&lt;br /&gt;
&lt;br /&gt;
* Ian Stuart - EDINA&lt;br /&gt;
* David McElroy - University of Glasgow&lt;br /&gt;
* Dawid Pachla  - University of Glasgow&lt;br /&gt;
* Chris Yocum - EDINA&lt;br /&gt;
&lt;br /&gt;
=Packages of Interest=&lt;br /&gt;
&lt;br /&gt;
DON'T TOUCH: Shelves, Coverpage, REF, eNova, Kultivate&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10606</id>
		<title>Bazaar Edinburgh 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10606"/>
		<updated>2012-08-02T09:35:05Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Batch Edit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints_Bazaar]]&lt;br /&gt;
&lt;br /&gt;
This page offers an agenda for the 3 day Bazaar development event in Edinburgh 1-3 August 2012.&lt;br /&gt;
&lt;br /&gt;
Location: EH9 1PR&lt;br /&gt;
&lt;br /&gt;
Over the course of the days the aim is to test, document and better represent our selves in the bazaar store where things are already a little messy (slap wrists people). Through testing of packages we need to improve descriptions, icons and compliment the packages with screen shots to help our users. &lt;br /&gt;
&lt;br /&gt;
=Day 1 - Wednesday 1st August 2012=&lt;br /&gt;
&lt;br /&gt;
* Bazaar &lt;br /&gt;
** Package Improvement, Config, Dependancies, Documentation, Screenshot&lt;br /&gt;
*** Amazon S3&lt;br /&gt;
*** Green Spring&lt;br /&gt;
*** Batch Edit&lt;br /&gt;
*** Icon Builder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
** Dependencies Ideas&lt;br /&gt;
** Bazaar Store Improvements - Seal of Approval, Screenshots, Tags, Display of Dependancies Field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Core&lt;br /&gt;
** Loosing Data on Disable/Uninstall&lt;br /&gt;
&lt;br /&gt;
===Green Spring===&lt;br /&gt;
* Capture screenshot&lt;br /&gt;
&lt;br /&gt;
===Batch Edit===&lt;br /&gt;
* Installer fails to detect a lack of external dependencies: Spreadsheet::ParseExcel, Spreadsheet::WriteExcel&lt;br /&gt;
* Install is a silent fail&lt;br /&gt;
* Uninstall fails with a misleading error (&amp;quot;Repository configuration not reloaded. Errors in configuration files&amp;quot; rather than not actually active)&lt;br /&gt;
** The fix is to edit the config, and save. This allows you to uninstall.&lt;br /&gt;
* The export function appears to work properly, however, I cannot even find the import option.&lt;br /&gt;
* In all honesty, I don't think this plugin can be described as &amp;quot;functional&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===EXIF Import===&lt;br /&gt;
* Captured screenshots&lt;br /&gt;
* Plugin description could be a bit less brief&lt;br /&gt;
* Plugin does not actually work&lt;br /&gt;
* There is a dependancy on IMAGE::Exif&lt;br /&gt;
* once that is installed the plugin still fails&lt;br /&gt;
* Unhandled warning in Import::EXIF: File not found: *Fh::fh00001bear.jpg &lt;br /&gt;
* Warning	Import failed: 1 item(s) imported before an error caused the import to abort.&lt;br /&gt;
&lt;br /&gt;
===Icon Builder===&lt;br /&gt;
* Installs without issue&lt;br /&gt;
* must navigate to cgi/icon_builder (this should probably be a screen plugin with a link in key_tools or the admin panels)&lt;br /&gt;
* you can upload a jpg and modify the baground colour.&lt;br /&gt;
* when you hit export the file it returns is not a vaild jpeg&lt;br /&gt;
&lt;br /&gt;
===AmazonS3===&lt;br /&gt;
* Installed &lt;br /&gt;
* updated package to do dependancy checking and output appropriate error messages&lt;br /&gt;
* outputs help to configure after installation &lt;br /&gt;
* created an example storeage policy&lt;br /&gt;
* tested fully&lt;br /&gt;
* dave t and dave m took screen shots&lt;br /&gt;
&lt;br /&gt;
===OREExport===&lt;br /&gt;
* Installed plugin&lt;br /&gt;
* Took screen shots&lt;br /&gt;
* Export works &lt;br /&gt;
* Import works&lt;br /&gt;
&lt;br /&gt;
===SNEEP===&lt;br /&gt;
* Installed &lt;br /&gt;
* works&lt;br /&gt;
* Screenshots&lt;br /&gt;
&lt;br /&gt;
===Schedule===&lt;br /&gt;
* 11:30 - A Simple Start, take the easy packages and improve and screen shot them.&lt;br /&gt;
* 12:45 - Lunch&lt;br /&gt;
* 14:00 - Complex Bazaar Package Testing&lt;br /&gt;
The idea here is to test the more complex packages (those that require dependencies outside of those needed by eprints) and work out how to best support our &amp;quot;one click&amp;quot; users in installing these packages. Additionally we should looks for packages that need config and make sure they have a &amp;quot;config&amp;quot; link!. These packages include:&lt;br /&gt;
** Coversheets&lt;br /&gt;
** Preservation Toolkit&lt;br /&gt;
** Tweepository&lt;br /&gt;
** Open Office Toolkit&lt;br /&gt;
&lt;br /&gt;
=Day 2 - Thursday 2nd August 2012=&lt;br /&gt;
&lt;br /&gt;
* 09:30 - Bazaar Store Upgrades &amp;amp; Package Testing&lt;br /&gt;
Put all the stuff from yesterday in the store. &lt;br /&gt;
** Screenshots &lt;br /&gt;
** Dependencies&lt;br /&gt;
** Descriptions &lt;br /&gt;
** Icons&lt;br /&gt;
* 11:00 - Languages Packs &lt;br /&gt;
Take the language packs from files and put them in the store. &lt;br /&gt;
* 12:30 - Lunch&lt;br /&gt;
* 13:30 - Package Fest&lt;br /&gt;
&lt;br /&gt;
=Day 3 - Friday 3rd August 2012=&lt;br /&gt;
* Package Fest&lt;br /&gt;
&lt;br /&gt;
[[File:DSC_0020.JPG|thumb]]&lt;br /&gt;
&lt;br /&gt;
=Attendees=&lt;br /&gt;
&lt;br /&gt;
* Les Carr - University of Southampton&lt;br /&gt;
* David Tarrant - University of Southampton&lt;br /&gt;
* Tim Brody - University of Southampton&lt;br /&gt;
* Patrick McSweeney - University of Southampton&lt;br /&gt;
* Matthew Taylor - University of Southampton&lt;br /&gt;
* Adam Field - University of Southampton&lt;br /&gt;
&lt;br /&gt;
Please add your name ...&lt;br /&gt;
&lt;br /&gt;
* Ian Stuart - EDINA&lt;br /&gt;
* David McElroy - University of Glasgow&lt;br /&gt;
* Dawid Pachla  - University of Glasgow&lt;br /&gt;
* Chris Yocum - EDINA&lt;br /&gt;
&lt;br /&gt;
=Packages of Interest=&lt;br /&gt;
&lt;br /&gt;
DON'T TOUCH: Shelves, Coverpage, REF, eNova, Kultivate&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10605</id>
		<title>Bazaar Edinburgh 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10605"/>
		<updated>2012-08-02T09:18:55Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Batch Edit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints_Bazaar]]&lt;br /&gt;
&lt;br /&gt;
This page offers an agenda for the 3 day Bazaar development event in Edinburgh 1-3 August 2012.&lt;br /&gt;
&lt;br /&gt;
Location: EH9 1PR&lt;br /&gt;
&lt;br /&gt;
Over the course of the days the aim is to test, document and better represent our selves in the bazaar store where things are already a little messy (slap wrists people). Through testing of packages we need to improve descriptions, icons and compliment the packages with screen shots to help our users. &lt;br /&gt;
&lt;br /&gt;
=Day 1 - Wednesday 1st August 2012=&lt;br /&gt;
&lt;br /&gt;
* Bazaar &lt;br /&gt;
** Package Improvement, Config, Dependancies, Documentation, Screenshot&lt;br /&gt;
*** Amazon S3&lt;br /&gt;
*** Green Spring&lt;br /&gt;
*** Batch Edit&lt;br /&gt;
*** Icon Builder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
** Dependencies Ideas&lt;br /&gt;
** Bazaar Store Improvements - Seal of Approval, Screenshots, Tags, Display of Dependancies Field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Core&lt;br /&gt;
** Loosing Data on Disable/Uninstall&lt;br /&gt;
&lt;br /&gt;
===Green Spring===&lt;br /&gt;
* Capture screenshot&lt;br /&gt;
&lt;br /&gt;
===Batch Edit===&lt;br /&gt;
* Installer fails to detect a lack of external dependencies: Spreadsheet::ParseExcel, Spreadsheet::WriteExcel&lt;br /&gt;
* Install is a silent fail&lt;br /&gt;
* Uninstall fails with a misleading error (&amp;quot;Repository configuration not reloaded. Errors in configuration files&amp;quot; rather than not actually active)&lt;br /&gt;
* The export function appears to work properly, however, I cannot even find the import option.&lt;br /&gt;
* In all honesty, I don't think this plugin can be described as &amp;quot;functional&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===EXIF Import===&lt;br /&gt;
* Captured screenshots&lt;br /&gt;
* Plugin description could be a bit less brief&lt;br /&gt;
* Plugin does not actually work&lt;br /&gt;
* There is a dependancy on IMAGE::Exif&lt;br /&gt;
* once that is installed the plugin still fails&lt;br /&gt;
* Unhandled warning in Import::EXIF: File not found: *Fh::fh00001bear.jpg &lt;br /&gt;
* Warning	Import failed: 1 item(s) imported before an error caused the import to abort.&lt;br /&gt;
&lt;br /&gt;
===Icon Builder===&lt;br /&gt;
* Installs without issue&lt;br /&gt;
* must navigate to cgi/icon_builder (this should probably be a screen plugin with a link in key_tools or the admin panels)&lt;br /&gt;
* you can upload a jpg and modify the baground colour.&lt;br /&gt;
* when you hit export the file it returns is not a vaild jpeg&lt;br /&gt;
&lt;br /&gt;
===AmazonS3===&lt;br /&gt;
* Installed &lt;br /&gt;
* updated package to do dependancy checking and output appropriate error messages&lt;br /&gt;
* outputs help to configure after installation &lt;br /&gt;
* created an example storeage policy&lt;br /&gt;
* tested fully&lt;br /&gt;
* dave t and dave m took screen shots&lt;br /&gt;
&lt;br /&gt;
===OREExport===&lt;br /&gt;
* Installed plugin&lt;br /&gt;
* Took screen shots&lt;br /&gt;
* Export works &lt;br /&gt;
* Import works&lt;br /&gt;
&lt;br /&gt;
===SNEEP===&lt;br /&gt;
* Installed &lt;br /&gt;
* works&lt;br /&gt;
* Screenshots&lt;br /&gt;
&lt;br /&gt;
===Schedule===&lt;br /&gt;
* 11:30 - A Simple Start, take the easy packages and improve and screen shot them.&lt;br /&gt;
* 12:45 - Lunch&lt;br /&gt;
* 14:00 - Complex Bazaar Package Testing&lt;br /&gt;
The idea here is to test the more complex packages (those that require dependencies outside of those needed by eprints) and work out how to best support our &amp;quot;one click&amp;quot; users in installing these packages. Additionally we should looks for packages that need config and make sure they have a &amp;quot;config&amp;quot; link!. These packages include:&lt;br /&gt;
** Coversheets&lt;br /&gt;
** Preservation Toolkit&lt;br /&gt;
** Tweepository&lt;br /&gt;
** Open Office Toolkit&lt;br /&gt;
&lt;br /&gt;
=Day 2 - Thursday 2nd August 2012=&lt;br /&gt;
&lt;br /&gt;
* 09:30 - Bazaar Store Upgrades &amp;amp; Package Testing&lt;br /&gt;
Put all the stuff from yesterday in the store. &lt;br /&gt;
** Screenshots &lt;br /&gt;
** Dependencies&lt;br /&gt;
** Descriptions &lt;br /&gt;
** Icons&lt;br /&gt;
* 11:00 - Languages Packs &lt;br /&gt;
Take the language packs from files and put them in the store. &lt;br /&gt;
* 12:30 - Lunch&lt;br /&gt;
* 13:30 - Package Fest&lt;br /&gt;
&lt;br /&gt;
=Day 3 - Friday 3rd August 2012=&lt;br /&gt;
* Package Fest&lt;br /&gt;
&lt;br /&gt;
[[File:DSC_0020.JPG|thumb]]&lt;br /&gt;
&lt;br /&gt;
=Attendees=&lt;br /&gt;
&lt;br /&gt;
* Les Carr - University of Southampton&lt;br /&gt;
* David Tarrant - University of Southampton&lt;br /&gt;
* Tim Brody - University of Southampton&lt;br /&gt;
* Patrick McSweeney - University of Southampton&lt;br /&gt;
* Matthew Taylor - University of Southampton&lt;br /&gt;
* Adam Field - University of Southampton&lt;br /&gt;
&lt;br /&gt;
Please add your name ...&lt;br /&gt;
&lt;br /&gt;
* Ian Stuart - EDINA&lt;br /&gt;
* David McElroy - University of Glasgow&lt;br /&gt;
* Dawid Pachla  - University of Glasgow&lt;br /&gt;
* Chris Yocum - EDINA&lt;br /&gt;
&lt;br /&gt;
=Packages of Interest=&lt;br /&gt;
&lt;br /&gt;
DON'T TOUCH: Shelves, Coverpage, REF, eNova, Kultivate&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10604</id>
		<title>Bazaar Edinburgh 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10604"/>
		<updated>2012-08-02T09:14:43Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints_Bazaar]]&lt;br /&gt;
&lt;br /&gt;
This page offers an agenda for the 3 day Bazaar development event in Edinburgh 1-3 August 2012.&lt;br /&gt;
&lt;br /&gt;
Location: EH9 1PR&lt;br /&gt;
&lt;br /&gt;
Over the course of the days the aim is to test, document and better represent our selves in the bazaar store where things are already a little messy (slap wrists people). Through testing of packages we need to improve descriptions, icons and compliment the packages with screen shots to help our users. &lt;br /&gt;
&lt;br /&gt;
=Day 1 - Wednesday 1st August 2012=&lt;br /&gt;
&lt;br /&gt;
* Bazaar &lt;br /&gt;
** Package Improvement, Config, Dependancies, Documentation, Screenshot&lt;br /&gt;
*** Amazon S3&lt;br /&gt;
*** Green Spring&lt;br /&gt;
*** Batch Edit&lt;br /&gt;
*** Icon Builder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
** Dependencies Ideas&lt;br /&gt;
** Bazaar Store Improvements - Seal of Approval, Screenshots, Tags, Display of Dependancies Field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Core&lt;br /&gt;
** Loosing Data on Disable/Uninstall&lt;br /&gt;
&lt;br /&gt;
===Green Spring===&lt;br /&gt;
* Capture screenshot&lt;br /&gt;
&lt;br /&gt;
===Batch Edit===&lt;br /&gt;
* Installer fails to detect a lack of external dependencies: Spreadsheet::ParseExcel, Spreadsheet::WriteExcel&lt;br /&gt;
* Install is a silent fail&lt;br /&gt;
* Uninstall fails with a misleading error (&amp;quot;Repository configuration not reloaded. Errors in configuration files&amp;quot; rather than not actually active)&lt;br /&gt;
&lt;br /&gt;
===EXIF Import===&lt;br /&gt;
* Captured screenshots&lt;br /&gt;
* Plugin description could be a bit less brief&lt;br /&gt;
* Plugin does not actually work&lt;br /&gt;
* There is a dependancy on IMAGE::Exif&lt;br /&gt;
* once that is installed the plugin still fails&lt;br /&gt;
* Unhandled warning in Import::EXIF: File not found: *Fh::fh00001bear.jpg &lt;br /&gt;
* Warning	Import failed: 1 item(s) imported before an error caused the import to abort.&lt;br /&gt;
&lt;br /&gt;
===Icon Builder===&lt;br /&gt;
* Installs without issue&lt;br /&gt;
* must navigate to cgi/icon_builder (this should probably be a screen plugin with a link in key_tools or the admin panels)&lt;br /&gt;
* you can upload a jpg and modify the baground colour.&lt;br /&gt;
* when you hit export the file it returns is not a vaild jpeg&lt;br /&gt;
&lt;br /&gt;
===AmazonS3===&lt;br /&gt;
* Installed &lt;br /&gt;
* updated package to do dependancy checking and output appropriate error messages&lt;br /&gt;
* outputs help to configure after installation &lt;br /&gt;
* created an example storeage policy&lt;br /&gt;
* tested fully&lt;br /&gt;
* dave t and dave m took screen shots&lt;br /&gt;
&lt;br /&gt;
===OREExport===&lt;br /&gt;
* Installed plugin&lt;br /&gt;
* Took screen shots&lt;br /&gt;
* Export works &lt;br /&gt;
* Import works&lt;br /&gt;
&lt;br /&gt;
===SNEEP===&lt;br /&gt;
* Installed &lt;br /&gt;
* works&lt;br /&gt;
* Screenshots&lt;br /&gt;
&lt;br /&gt;
===Schedule===&lt;br /&gt;
* 11:30 - A Simple Start, take the easy packages and improve and screen shot them.&lt;br /&gt;
* 12:45 - Lunch&lt;br /&gt;
* 14:00 - Complex Bazaar Package Testing&lt;br /&gt;
The idea here is to test the more complex packages (those that require dependencies outside of those needed by eprints) and work out how to best support our &amp;quot;one click&amp;quot; users in installing these packages. Additionally we should looks for packages that need config and make sure they have a &amp;quot;config&amp;quot; link!. These packages include:&lt;br /&gt;
** Coversheets&lt;br /&gt;
** Preservation Toolkit&lt;br /&gt;
** Tweepository&lt;br /&gt;
** Open Office Toolkit&lt;br /&gt;
&lt;br /&gt;
=Day 2 - Thursday 2nd August 2012=&lt;br /&gt;
&lt;br /&gt;
* 09:30 - Bazaar Store Upgrades &amp;amp; Package Testing&lt;br /&gt;
Put all the stuff from yesterday in the store. &lt;br /&gt;
** Screenshots &lt;br /&gt;
** Dependencies&lt;br /&gt;
** Descriptions &lt;br /&gt;
** Icons&lt;br /&gt;
* 11:00 - Languages Packs &lt;br /&gt;
Take the language packs from files and put them in the store. &lt;br /&gt;
* 12:30 - Lunch&lt;br /&gt;
* 13:30 - Package Fest&lt;br /&gt;
&lt;br /&gt;
=Day 3 - Friday 3rd August 2012=&lt;br /&gt;
* Package Fest&lt;br /&gt;
&lt;br /&gt;
[[File:DSC_0020.JPG|thumb]]&lt;br /&gt;
&lt;br /&gt;
=Attendees=&lt;br /&gt;
&lt;br /&gt;
* Les Carr - University of Southampton&lt;br /&gt;
* David Tarrant - University of Southampton&lt;br /&gt;
* Tim Brody - University of Southampton&lt;br /&gt;
* Patrick McSweeney - University of Southampton&lt;br /&gt;
* Matthew Taylor - University of Southampton&lt;br /&gt;
* Adam Field - University of Southampton&lt;br /&gt;
&lt;br /&gt;
Please add your name ...&lt;br /&gt;
&lt;br /&gt;
* Ian Stuart - EDINA&lt;br /&gt;
* David McElroy - University of Glasgow&lt;br /&gt;
* Dawid Pachla  - University of Glasgow&lt;br /&gt;
* Chris Yocum - EDINA&lt;br /&gt;
&lt;br /&gt;
=Packages of Interest=&lt;br /&gt;
&lt;br /&gt;
DON'T TOUCH: Shelves, Coverpage, REF, eNova, Kultivate&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10603</id>
		<title>Bazaar Edinburgh 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10603"/>
		<updated>2012-08-02T09:13:28Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Batch Edit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints_Bazaar]]&lt;br /&gt;
&lt;br /&gt;
This page offers an agenda for the 3 day Bazaar development event in Edinburgh 1-3 August 2012.&lt;br /&gt;
&lt;br /&gt;
Location: EH9 1PR&lt;br /&gt;
&lt;br /&gt;
Over the course of the days the aim is to test, document and better represent our selves in the bazaar store where things are already a little messy (slap wrists people). Through testing of packages we need to improve descriptions, icons and compliment the packages with screen shots to help our users. &lt;br /&gt;
&lt;br /&gt;
=Day 1 - Wednesday 1st August 2012=&lt;br /&gt;
&lt;br /&gt;
* Bazaar &lt;br /&gt;
** Package Improvement, Config, Dependancies, Documentation, Screenshot&lt;br /&gt;
*** Amazon S3&lt;br /&gt;
*** Green Spring&lt;br /&gt;
*** Batch Edit&lt;br /&gt;
*** Icon Builder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
** Dependencies Ideas&lt;br /&gt;
** Bazaar Store Improvements - Seal of Approval, Screenshots, Tags, Display of Dependancies Field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Core&lt;br /&gt;
** Loosing Data on Disable/Uninstall&lt;br /&gt;
&lt;br /&gt;
===Green Spring===&lt;br /&gt;
* Capture screenshot&lt;br /&gt;
&lt;br /&gt;
===Batch Edit===&lt;br /&gt;
* Installer fails to detect a lack of external dependencies: Spreadsheet::ParseExcel, Spreadsheet::WriteExcel&lt;br /&gt;
* Install is a silent fail&lt;br /&gt;
* Uninstall fails with a misleading error (&amp;quot;Repository configuration not reloaded. Errors in configuration files&amp;quot; rather than not actually active)&lt;br /&gt;
&lt;br /&gt;
===EXIF Import===&lt;br /&gt;
* Captured screenshots&lt;br /&gt;
* Plugin description could be a bit less brief&lt;br /&gt;
* Plugin does not actually work&lt;br /&gt;
* There is a dependancy on IMAGE::Exif&lt;br /&gt;
* once that is installed the plugin still fails&lt;br /&gt;
* Unhandled warning in Import::EXIF: File not found: *Fh::fh00001bear.jpg &lt;br /&gt;
* Warning	Import failed: 1 item(s) imported before an error caused the import to abort.&lt;br /&gt;
&lt;br /&gt;
===Icon Builder===&lt;br /&gt;
* Installs without issue&lt;br /&gt;
* must navigate to cgi/icon_builder (this should probably be a screen plugin with a link in key_tools or the admin panels)&lt;br /&gt;
* you can upload a jpg and modify the baground colour.&lt;br /&gt;
* when you hit export the file it returns is not a vaild jpeg&lt;br /&gt;
&lt;br /&gt;
===AmazonS3===&lt;br /&gt;
* Installed &lt;br /&gt;
* updated package to do dependancy checking and output appropriate error messages&lt;br /&gt;
* outputs help to configure after installation &lt;br /&gt;
* created an example storeage policy&lt;br /&gt;
* tested fully&lt;br /&gt;
* dave t and dave m took screen shots&lt;br /&gt;
&lt;br /&gt;
===OREExport===&lt;br /&gt;
* Installed plugin&lt;br /&gt;
* Took screen shots&lt;br /&gt;
* Export works &lt;br /&gt;
* Import works&lt;br /&gt;
&lt;br /&gt;
===SNEEP===&lt;br /&gt;
* Installed &lt;br /&gt;
* works&lt;br /&gt;
* Screenshots&lt;br /&gt;
&lt;br /&gt;
===Schedule===&lt;br /&gt;
* 11:30 - A Simple Start, take the easy packages and improve and screen shot them.&lt;br /&gt;
* 12:30 - Lunch&lt;br /&gt;
* 13:30 - Complex Bazaar Package Testing&lt;br /&gt;
The idea here is to test the more complex packages (those that require dependencies outside of those needed by eprints) and work out how to best support our &amp;quot;one click&amp;quot; users in installing these packages. Additionally we should looks for packages that need config and make sure they have a &amp;quot;config&amp;quot; link!. These packages include:&lt;br /&gt;
** Coversheets&lt;br /&gt;
** Preservation Toolkit&lt;br /&gt;
** Tweepository&lt;br /&gt;
** Open Office Toolkit&lt;br /&gt;
&lt;br /&gt;
=Day 2 - Thursday 2nd August 2012=&lt;br /&gt;
&lt;br /&gt;
* 09:30 - Bazaar Store Upgrades &amp;amp; Package Testing&lt;br /&gt;
Put all the stuff from yesterday in the store. &lt;br /&gt;
** Screenshots &lt;br /&gt;
** Dependencies&lt;br /&gt;
** Descriptions &lt;br /&gt;
** Icons&lt;br /&gt;
* 11:00 - Languages Packs &lt;br /&gt;
Take the language packs from files and put them in the store. &lt;br /&gt;
* 12:30 - Lunch&lt;br /&gt;
* 13:30 - Package Fest&lt;br /&gt;
&lt;br /&gt;
=Day 3 - Friday 3rd August 2012=&lt;br /&gt;
* Package Fest&lt;br /&gt;
&lt;br /&gt;
[[File:DSC_0020.JPG|thumb]]&lt;br /&gt;
&lt;br /&gt;
=Attendees=&lt;br /&gt;
&lt;br /&gt;
* Les Carr - University of Southampton&lt;br /&gt;
* David Tarrant - University of Southampton&lt;br /&gt;
* Tim Brody - University of Southampton&lt;br /&gt;
* Patrick McSweeney - University of Southampton&lt;br /&gt;
* Matthew Taylor - University of Southampton&lt;br /&gt;
* Adam Field - University of Southampton&lt;br /&gt;
&lt;br /&gt;
Please add your name ...&lt;br /&gt;
&lt;br /&gt;
* Ian Stuart - EDINA&lt;br /&gt;
* David McElroy - University of Glasgow&lt;br /&gt;
* Dawid Pachla  - University of Glasgow&lt;br /&gt;
* Chris Yocum - EDINA&lt;br /&gt;
&lt;br /&gt;
=Packages of Interest=&lt;br /&gt;
&lt;br /&gt;
DON'T TOUCH: Shelves, Coverpage, REF, eNova, Kultivate&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10602</id>
		<title>Bazaar Edinburgh 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Bazaar_Edinburgh_2012&amp;diff=10602"/>
		<updated>2012-08-02T09:00:55Z</updated>

		<summary type="html">&lt;p&gt;Kiz: /* Day 1 - Wednesday 1st August 2012 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints_Bazaar]]&lt;br /&gt;
&lt;br /&gt;
This page offers an agenda for the 3 day Bazaar development event in Edinburgh 1-3 August 2012.&lt;br /&gt;
&lt;br /&gt;
Location: EH9 1PR&lt;br /&gt;
&lt;br /&gt;
Over the course of the days the aim is to test, document and better represent our selves in the bazaar store where things are already a little messy (slap wrists people). Through testing of packages we need to improve descriptions, icons and compliment the packages with screen shots to help our users. &lt;br /&gt;
&lt;br /&gt;
=Day 1 - Wednesday 1st August 2012=&lt;br /&gt;
&lt;br /&gt;
* Bazaar &lt;br /&gt;
** Package Improvement, Config, Dependancies, Documentation, Screenshot&lt;br /&gt;
*** Amazon S3&lt;br /&gt;
*** Green Spring&lt;br /&gt;
*** Batch Edit&lt;br /&gt;
*** Icon Builder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
** Dependencies Ideas&lt;br /&gt;
** Bazaar Store Improvements - Seal of Approval, Screenshots, Tags, Display of Dependancies Field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Core&lt;br /&gt;
** Loosing Data on Disable/Uninstall&lt;br /&gt;
&lt;br /&gt;
===Green Spring===&lt;br /&gt;
* Capture screenshot&lt;br /&gt;
&lt;br /&gt;
===Batch Edit===&lt;br /&gt;
* Installer fails to detect a lack of external dependencies: Spreadsheet::ParseExcel, Spreadsheet::WeiteExcel&lt;br /&gt;
* Install is a silent fail&lt;br /&gt;
* Uninstall fails with a misleading error (&amp;quot;Repository configuration not reloaded. Errors in configuration files&amp;quot; rather than not actually active)&lt;br /&gt;
&lt;br /&gt;
===EXIF Import===&lt;br /&gt;
* Captured screenshots&lt;br /&gt;
* Plugin description could be a bit less brief&lt;br /&gt;
* Plugin does not actually work&lt;br /&gt;
* There is a dependancy on IMAGE::Exif&lt;br /&gt;
* once that is installed the plugin still fails&lt;br /&gt;
* Unhandled warning in Import::EXIF: File not found: *Fh::fh00001bear.jpg &lt;br /&gt;
* Warning	Import failed: 1 item(s) imported before an error caused the import to abort.&lt;br /&gt;
&lt;br /&gt;
===Icon Builder===&lt;br /&gt;
* Installs without issue&lt;br /&gt;
* must navigate to cgi/icon_builder (this should probably be a screen plugin with a link in key_tools or the admin panels)&lt;br /&gt;
* you can upload a jpg and modify the baground colour.&lt;br /&gt;
* when you hit export the file it returns is not a vaild jpeg&lt;br /&gt;
&lt;br /&gt;
===AmazonS3===&lt;br /&gt;
* Installed &lt;br /&gt;
* updated package to do dependancy checking and output appropriate error messages&lt;br /&gt;
* outputs help to configure after installation &lt;br /&gt;
* created an example storeage policy&lt;br /&gt;
* tested fully&lt;br /&gt;
* dave t and dave m took screen shots&lt;br /&gt;
&lt;br /&gt;
===OREExport===&lt;br /&gt;
* Installed plugin&lt;br /&gt;
* Took screen shots&lt;br /&gt;
* Export works &lt;br /&gt;
* Import works&lt;br /&gt;
&lt;br /&gt;
===SNEEP===&lt;br /&gt;
* Installed &lt;br /&gt;
* works&lt;br /&gt;
* Screenshots&lt;br /&gt;
&lt;br /&gt;
===Schedule===&lt;br /&gt;
* 11:30 - A Simple Start, take the easy packages and improve and screen shot them.&lt;br /&gt;
* 12:30 - Lunch&lt;br /&gt;
* 13:30 - Complex Bazaar Package Testing&lt;br /&gt;
The idea here is to test the more complex packages (those that require dependencies outside of those needed by eprints) and work out how to best support our &amp;quot;one click&amp;quot; users in installing these packages. Additionally we should looks for packages that need config and make sure they have a &amp;quot;config&amp;quot; link!. These packages include:&lt;br /&gt;
** Coversheets&lt;br /&gt;
** Preservation Toolkit&lt;br /&gt;
** Tweepository&lt;br /&gt;
** Open Office Toolkit&lt;br /&gt;
&lt;br /&gt;
=Day 2 - Thursday 2nd August 2012=&lt;br /&gt;
&lt;br /&gt;
* 09:30 - Bazaar Store Upgrades &amp;amp; Package Testing&lt;br /&gt;
Put all the stuff from yesterday in the store. &lt;br /&gt;
** Screenshots &lt;br /&gt;
** Dependencies&lt;br /&gt;
** Descriptions &lt;br /&gt;
** Icons&lt;br /&gt;
* 11:00 - Languages Packs &lt;br /&gt;
Take the language packs from files and put them in the store. &lt;br /&gt;
* 12:30 - Lunch&lt;br /&gt;
* 13:30 - Package Fest&lt;br /&gt;
&lt;br /&gt;
=Day 3 - Friday 3rd August 2012=&lt;br /&gt;
* Package Fest&lt;br /&gt;
&lt;br /&gt;
[[File:DSC_0020.JPG|thumb]]&lt;br /&gt;
&lt;br /&gt;
=Attendees=&lt;br /&gt;
&lt;br /&gt;
* Les Carr - University of Southampton&lt;br /&gt;
* David Tarrant - University of Southampton&lt;br /&gt;
* Tim Brody - University of Southampton&lt;br /&gt;
* Patrick McSweeney - University of Southampton&lt;br /&gt;
* Matthew Taylor - University of Southampton&lt;br /&gt;
* Adam Field - University of Southampton&lt;br /&gt;
&lt;br /&gt;
Please add your name ...&lt;br /&gt;
&lt;br /&gt;
* Ian Stuart - EDINA&lt;br /&gt;
* David McElroy - University of Glasgow&lt;br /&gt;
* Dawid Pachla  - University of Glasgow&lt;br /&gt;
* Chris Yocum - EDINA&lt;br /&gt;
&lt;br /&gt;
=Packages of Interest=&lt;br /&gt;
&lt;br /&gt;
DON'T TOUCH: Shelves, Coverpage, REF, eNova, Kultivate&lt;/div&gt;</summary>
		<author><name>Kiz</name></author>
		
	</entry>
</feed>