Difference between revisions of "Demoprints Repository"

From EPrints Documentation
Jump to: navigation, search
(demoprints setup)
 
m (Update the welcome message)
Line 27: Line 27:
  
 
* Add the following to the top message box in index.xpage
 
* Add the following to the top message box in index.xpage
 
+
<nowiki>
 
   <ul>
 
   <ul>
 
   <li>This repository is a demonstration of <epc:print expr="$config{version_id}" />.</li>
 
   <li>This repository is a demonstration of <epc:print expr="$config{version_id}" />.</li>
Line 33: Line 33:
 
   <li>All changes are reset automatically every <b>Sunday at 4am</b>, at which point all data is lost.</li>
 
   <li>All changes are reset automatically every <b>Sunday at 4am</b>, at which point all data is lost.</li>
 
   </ul>
 
   </ul>
 +
</nowiki>
  
 
== Add the reset scripts ==
 
== Add the reset scripts ==

Revision as of 18:25, 29 January 2009

This is a brief guide on how-to setup and install and maintain the demoprints.eprints.org repository

1: Base Install

  • Obtain a VM from the VM Pool (contact ld@ecs)
  • Install debian on it and follow the Installing EPrints 3 via apt (Debian/Ubuntu) guide to install eprints
  • Configure and Install a basic repository called demoprints with a demoprints mysql database

2: Customisations

Stop users from editing perl files

  • removed the roles field from the workflows/user/default.xml
  • removed the edit-config priv from cfg.d/user_roles.p

Allow users to create themselves an Admin account

  • add usertype to the following line in registration.pl
$c->{user_registration_fields} = [ "name","usertype" ];

Install postfix for mail delivery

  • You may also need to contact postmaster@ecs to get the server permission to send email

Update the welcome message

  • Add the following to the top message box in index.xpage

<ul> <li>This repository is a demonstration of <epc:print expr="$config{version_id}" />.</li> <li>It is open for anyone to manage and change.</li><li>You may register as an administrator or editor (on a normal installation you could not do this).</li> <li>All changes are reset automatically every <b>Sunday at 4am</b>, at which point all data is lost.</li> </ul>

Add the reset scripts

  • create a file called demoprints_snapshot in the eprints home dir (as root), contents are:
 #!/bin/bash
 cd /usr/share/eprints3/archives/
 rm -f demoprints.*
 tar -cvf demoprints.tar demoprints
 mysqldump -u root demoprints > demoprints.sql
  • execute this file
  • create a file called demoprints_reset in the eprints home dir (as root), contents are:
 #!/bin/bash
 a2dissite eprints3
 /etc/init.d/apache2 reload
 cd /usr/share/eprints3/archives/
 rm -fR demoprints
 tar -xvf demoprints.tar
 mysqldump -u root demoprints user > users.sql
 echo "drop database demoprints" > mysql -u root
 echo "create database demoprints" > mysql -u root
 mysql -u root demoprints < demoprints.sql
 mysql -u root demoprints < users.sql
 rm -f users.sql
 a2ensite eprints3
 /etc/init.d/apache2 reload
  • create a file called demoprints_reset.cron in the eprints home dir (as root), contents are:
 0 4 * * 0 /usr/share/eprints3/demoprints_reset
  • make all the above files executable and add the cronjob to system startup

Upgrading the EPrints Software (untested at time of writing)

  • As root
 a2dissite eprints3
 /etc/init.d/apache2ctl reload
 apt-get update && apt-get install eprints
 
 ...follow messages
 su eprints
 cd
 ./bin/epadmin upgrade
 a2ensite eprints3
 /etc/init.d/apache2ctl reload