Difference between revisions of "Demoprints Repository"

From EPrints Documentation
Jump to: navigation, search
(Upgrading the EPrints Software (untested at time of writing))
Line 35: Line 35:
 
</nowiki>
 
</nowiki>
  
== Add the reset scripts ==
+
== Add the reset scripts (root) ==
  
 
* create a file called demoprints_snapshot in the eprints home dir (as root), contents are:
 
* create a file called demoprints_snapshot in the eprints home dir (as root), contents are:
Line 46: Line 46:
  
 
* execute this file
 
* execute this file
 +
 +
* create a file called demoprints_offine in the eprints home dir (as root), contents are:
 +
 
 +
  #!/bin/bash
 +
  a2dissite eprints3
 +
  /etc/init.d/apache2 reload
 +
 +
* create a file called demoprints_online in the eprints home dir (as root), contents are:
 +
 
 +
  #!/bin/bash
 +
  a2ensite eprints3
 +
  /etc/init.d/apache2 reload
  
 
* create a file called demoprints_reset in the eprints home dir (as root), contents are:
 
* create a file called demoprints_reset in the eprints home dir (as root), contents are:
Line 66: Line 78:
 
* create a file called demoprints_reset.cron in the eprints home dir (as root), contents are:
 
* create a file called demoprints_reset.cron in the eprints home dir (as root), contents are:
  
 +
  0 3 * * * /usr/share/eprints3/demoprints_offline
 +
  10 3 * * * /usr/share/eprints3/demoprints_online
 
   0 4 * * 0 /usr/share/eprints3/demoprints_reset
 
   0 4 * * 0 /usr/share/eprints3/demoprints_reset
 +
 +
* make all the above files executable and add the cronjob to system startup
 +
 +
== Add the reset scripts (eprints) ==
 +
 +
* create a file called demoprints_daily_reset in the eprints home dir (as eprints), contents are:
 +
 +
  #!/bin/bash
 +
  cd /usr/share/eprints3/archives/
 +
  rm -f /usr/share/eprints3/archives/demoprints/cfg/lang/en/phrases/zz_webcfg.xml
 +
  cp zz_webcfg.xml /usr/share/eprints3/archives/demoprints/cfg/lang/en/phrases/
 +
  cd demoprints/cfg/lang/en/
 +
  tar -xvf static.tar
 +
  cd /usr/share/eprints3/
 +
  ./bin/generate_static demoprints
 +
  ./bin/generate_views demoprints
 +
 +
* create a file called demoprints_import_data in the eprints home dir (as eprints), contents are:
 +
 +
  #!/bin/bash
 +
  cd /usr/share/eprints3/testdata
 +
  ./bin/import_test_data demoprints
 +
 +
* create a file called demoprints_reset_eprints.cron in the eprints home dir (as eprints), contents are:
 +
 +
  5 3 * * * /usr/share/eprints3/demoprints_daily_reset
 +
  10 4 * * 0 /usr/share/eprints3/demoprints_import_data
  
 
* make all the above files executable and add the cronjob to system startup
 
* make all the above files executable and add the cronjob to system startup

Revision as of 09:54, 2 March 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 (root)

  • 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_offine in the eprints home dir (as root), contents are:
 #!/bin/bash
 a2dissite eprints3
 /etc/init.d/apache2 reload
  • create a file called demoprints_online in the eprints home dir (as root), contents are:
 #!/bin/bash
 a2ensite eprints3
 /etc/init.d/apache2 reload
  • 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 3 * * * /usr/share/eprints3/demoprints_offline
 10 3 * * * /usr/share/eprints3/demoprints_online
 0 4 * * 0 /usr/share/eprints3/demoprints_reset
  • make all the above files executable and add the cronjob to system startup

Add the reset scripts (eprints)

  • create a file called demoprints_daily_reset in the eprints home dir (as eprints), contents are:
 #!/bin/bash
 cd /usr/share/eprints3/archives/
 rm -f /usr/share/eprints3/archives/demoprints/cfg/lang/en/phrases/zz_webcfg.xml
 cp zz_webcfg.xml /usr/share/eprints3/archives/demoprints/cfg/lang/en/phrases/
 cd demoprints/cfg/lang/en/
 tar -xvf static.tar
 cd /usr/share/eprints3/
 ./bin/generate_static demoprints
 ./bin/generate_views demoprints
  • create a file called demoprints_import_data in the eprints home dir (as eprints), contents are:
 #!/bin/bash
 cd /usr/share/eprints3/testdata
 ./bin/import_test_data demoprints
  • create a file called demoprints_reset_eprints.cron in the eprints home dir (as eprints), contents are:
 5 3 * * * /usr/share/eprints3/demoprints_daily_reset
 10 4 * * 0 /usr/share/eprints3/demoprints_import_data
  • 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